Thursday, 31 July 2014

Select the data from database using Linq to SQL

Simple query in Linq to SQL for selecting the data: try { DataBaseDataContext ZCLS = new DataBaseDataContext(new OdbcConnection(strConnection)); //execute query var result = from s in ZCLS.GroupAddresses select s; /* select new (s.ChannelNo,s.ChannelPhone,s.IPNo,s.ComputerName,s.UserName);*/ for selecting some of the fields. } catch (Exception ex) { // code yours }

No comments:

Post a Comment

How To Pass An Array As A Parameter While Calling an ASP.NET Web API C#

Please visit my C# Corner Blog for this, where I have provided better efforts to make this concept more understandable - www.c-sharpcorner....