Friday, November 21, 2008

LINQ

LINQ -Langauge INtegrated Query

LINQ - It is Unified Querying Language features in C# 3.0. using LINQ you can query any Relational DB ,DataSet ,XML , Object, XML etc...

suppose if we want to get all contacts from contacts table the LINQ Query looks like this


SAMPLE LINQ Query


SreeniDatabaseDataContext dbconn = new SreeniDatabaseDataContext ();

var contactRecords = from contact in dbconn.Contacts
select contact;

foreach ( var item in contactRecords )
{
Console.WriteLine(item.Name +" "+ item.Phone);
}




List of LINQ BOOKS




Thanks
SreenivasaRagavan.

No comments: