$(document).ready(function(){ $(window).on(‘beforeunload’, function(e){ if(CheckFunctionForConfirmation()){ return ‘Are you sure you want to leave without saving?’; } }); }); Read more →
SQL Server: Get foreign key dependencies
SELECT K_Table = FK.TABLE_NAME, FK_Column = CU.COLUMN_NAME, PK_Table = PK.TABLE_NAME, PK_Column = PT.COLUMN_NAME, Constraint_Name = C.CONSTRAINT_NAME FROM INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS C INNER JOIN INFORMATION_SCHEMA.TABLE_CONSTRAINTS FK ON C.CONSTRAINT_NAME = FK.CONSTRAINT_NAME INNER JOIN INFORMATION_SCHEMA.TABLE_CONSTRAINTS PK ON C.UNIQUE_CONSTRAINT_NAME = PK.CONSTRAINT_NAME INNER JOIN INFORMATION_SCHEMA.KEY_COLUMN_USAGE CU ON C.CONSTRAINT_NAME = CU.CONSTRAINT_NAME INNER JOIN ( SELECT i1.TABLE_NAME, i2.COLUMN_NAME FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS i1 INNER JOIN INFORMATION_SCHEMA.KEY_COLUMN_USAGE i2 ON i1.CONSTRAINT_NAME = i2.CONSTRAINT_NAME… Read more →
how to start session state service in windows
NET stop aspnet_state NET start aspnet_state Read more →
A fatal scripting error occurred
A fatal scripting error occurred.incorrect syntax was encountered while parsing go use separate line for bulk comment with Go Like Select 1 Go/* comment*/ Will not work. change it like: Select 1 Go /* comment*/ Read more →
Get all foreign key constraint from schema
SELECT K_Table = FK.TABLE_NAME, FK_Column = CU.COLUMN_NAME, PK_Table = PK.TABLE_NAME, PK_Column = PT.COLUMN_NAME, Constraint_Name = C.CONSTRAINT_NAME FROM INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS C INNER JOIN INFORMATION_SCHEMA.TABLE_CONSTRAINTS FK ON C.CONSTRAINT_NAME = FK.CONSTRAINT_NAME INNER JOIN INFORMATION_SCHEMA.TABLE_CONSTRAINTS PK ON C.UNIQUE_CONSTRAINT_NAME = PK.CONSTRAINT_NAME INNER JOIN INFORMATION_SCHEMA.KEY_COLUMN_USAGE CU ON C.CONSTRAINT_NAME = CU.CONSTRAINT_NAME INNER JOIN ( SELECT i1.TABLE_NAME, i2.COLUMN_NAME FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS i1 INNER JOIN INFORMATION_SCHEMA.KEY_COLUMN_USAGE i2 ON i1.CONSTRAINT_NAME = i2.CONSTRAINT_NAME… Read more →
design pattern
—factory and abstract factory pattern in .net———- Note: – This is quiet a confusing architect question especially in design pattern section. Interviewer can take you for a nice ride. So get the difference in your heart. First read the definition provided in the first question about both these patterns. The common thing they have is that they belong to creational patterns.… Read more →
webservices terminology
Web services— Disco The Web Service Discovery Tool (DISCO) is used to discover the URLs of XML Web Services located on a Web server and saves documents related to each XML service on a local disk. The DISCO takes the URL and discovers and produce publishes discovery documents (.wsdl, .xsd, .disco and .dicomap files) as arguments. UDDI Universal Description, Discovery… Read more →
Apicontroller and controller differences
ASP.NET MVC public class TweetsController : Controller { // GET: /Tweets/ [HttpGet] public ActionResult Index() { return Json(Twitter.GetTweets(), JsonRequestBehavior.AllowGet); } } ASP.NET Web API public class TweetsController : ApiController { // GET: /Api/Tweets/ public List<Tweet> Get() { return Twitter.GetTweets(); } } The first major difference you will notice is that actions on Web API controllers do not return views, they… Read more →
Datetime2,Datetime and Date Datatype differences
larger range of values better Accuracy smaller storage space (if optional user-specified precision is specified) Read more →
sql query updated
–update table with swap between two columns update mmm_1 set id=phone,phone=id; –delete duplicate value from data table and select not duplicate also with x as( select empid,lname,deptno,rn=ROW_NUMBER() over (partition by deptno order by deptno),rn1=dense_rank() over (partition by deptno order by deptno), rn2=Rank() over ( order by deptno) from employees) delete x where x.rn>1; –delete all duplicate values delete employees where… Read more →