Category: .Net

Download Visual Studio 2017 RC for offline installation

vs_Community.exe Install all languages vs_enterprise.exe –layout C:\vs2017 vs_Community.exe –layout C:\vs2017 Example B: Install one language vs_enterprise.exe –layout C:\vs2017 –lang en-US vs_Community.exe –layout C:\vs2017 –lang en-US Example C: Install multiple languages vs_enterprise.exe –layout C:\vs2017 –lang en-US de-DE ja-JP vs_Community.exe –layout C:\vs2017 –lang en-US de-DE ja-JP Read more →

SQL Server Data Type Mappings

  SQL Server Database Engine type .NET Framework type SqlDbType enumeration SqlDataReader SqlTypes typed accessor DbType enumeration SqlDataReader DbType typed accessor bigint Int64 BigInt GetSqlInt64 Int64 GetInt64 binary Byte[] VarBinary GetSqlBinary Binary GetBytes bit Boolean Bit GetSqlBoolean Boolean GetBoolean char String Char[] Char GetSqlString AnsiStringFixedLength, String GetString GetChars date (SQL Server 2008 and later) DateTime Date GetSqlDateTime Date GetDateTime datetime… 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 →

code for reverse string in c# and find duplicate record in jquery

static string reverse(string ss) { string[] strArray = ss.Split(‘ ‘) ; string revs=””; //int i = strArray.Length; StringBuilder sb = new StringBuilder(); for (int i = 0; i < strArray.Length; i++)   { string ty = string.Join(“”,strArray[i].Reverse().ToArray()); //            string firstLetter = strArray[i].Substring(0, 1); string firstLetter = ty.Substring(0, 1); //string secondPart = strArray[i].Substring(strArray[i].Length -2 ,0); string secondPart = ty.Substring(1);   sb.Append(firstLetter.ToUpper()… Read more →