How to Select Data Record in LINQ from table

 

Below code snippets in C# get the all contacts data records from ABCWorks database

ABCWorksDataContext dataContext = new ABCWorksDataContext();
var query = from contact in dataContext.Contacts
select contact;


Here ABCWorksDataContext represent Database Entity model. Contacts represent collection of data records. dataContext.Contacts represent the Object of table Contact.
query is type of variant that represent contact collection.

Comments

Popular posts from this blog

how to add meta tag elements dynamic in ASP.NET

How Azure Load Balancer Works

Defensive Programming Approach - A developer must have this skill