Sunday, February 13, 2011

What is LINQ?

LINQ stands for Language - Integrated Query. LINQ adds to C# the ability to generate query for any LINQ - compatible data source. Furthermore, the syntax used for the query is the same, no matter what data source is used. This means that the syntax used to query data in a relational database is the same as that used to query data stored in an array, for example. It is no longer necessary  to use SQL or any other non - C# mechanism. The query capability is fully integrated into the C# language.

 In addition to using LINQ with SQL, LINQ can be used with XML files and ADO.NET Datasets. Perhaps it is equally important, it can also be used with C# arrays and collections. Therefore, LINQ gives you a uniform way to access data.

LINQ is supported by a set of interrelated features, including the query syntax added to the C# language, lambda expressions, anonymous types, and extension methods.