Language Integrated Query (LINQ)

Lakhangarg
Posted by in Others category on for Beginner level | Views : 3692 red flag

LINQ Stands for Language-Integrated Query. LINQ has a great power of querying on any source of data, data source could be the collections of objects, database or XML files.
Introduction
LINQ Stands for Language-Integrated Query. LINQ has a great power of querying on any source of data, data source could be the collections of objects, database or XML files. We can easily retrieve data from any object that implements the IEnumerable interface. Microsoft basically divides LINQ into three areas and that are give below:

  • LINQ to Object {Queries performed against the in-memory data}
  • LINQ to ADO.Net
    • LINQ to SQL (formerly DLinq) {Queries performed against the relation database only Microsoft SQL Server Supported}
    • LINQ to DataSet {Supports queries by using ADO.NET data sets and data tables}
    • LINQ to Entities {Microsoft ORM solution}
  • LINQ to XML (formerly XLinq) { Queries performed against the XML source}
Example:
int[] nums = new int[] {0,1,2,3,4,5};
var res = from a in nums
where a < 3
orderby a
select a;
foreach(int i in res)
Console.WriteLine(i);
Output:
0
1
2
3
4
5

Page copy protected against web site content infringement by Copyscape

About the Author

Lakhangarg
Full Name: Lakhan Pal
Member Level: Silver
Member Status: Member,Moderator
Member Since: 8/17/2009 12:39:46 AM
Country: India

http://lakhangarg.blogspot.com
Hello Friends Myself Lakhan Pal Garg and i am a B.Tech (IT) Graduate and having 8+Years of Exp. in Microsoft Technology. I have Write a Blog Named Free Code Snippets (http://lakhangarg.blogspot.com/) I hope you must visit my blog as your valuable feedback will motivate me to write more and improve my mistake. If you want to gain more knowledge then share it with others.

Login to vote for this post.

Comments or Responses

Login to post response

Comment using Facebook(Author doesn't get notification)