LINQ

LINQ stands for language-integrated query. LINQ was initially introduced in Microsoft’s Visual Studio 2008, and adds powerful query capabilities to the language syntax of C# and Visual Basic.

LINQ uses generics and other powerful new features of .NET 2.0, as well as functional programming techniques, to create a query syntax that provides high-level data abstraction and make it easier to write accurate, useful queries

The major advantage of LINQ is that it provides a number of standardized patterns for querying and updating data, and can be extended to support almost any kind of data store. Visual Studio comes with a variety of LINQ provider assemblies that make possible the use of LINQ with .NET Framework collections, SQL Server databases, ADO.NET Datasets and XML documents.

In the past, queries against data have typically been expressed as simple strings without much (if any) type checking at compilation. Furthermore, writing queries required being familiar with a separate query language for each type of data source (SQL databases, XML documents, Web services, etc.). With LINQ, queries become a first-class language construct in both C# and Visual Basic.

LINQ  is broken down into three syntaxes:

  1. LINQ to Objects
  1. LINQ to ADO.NET, which includes
  • LINQ to DataSet
  • LINQ to Entities
  • LINQ to SQL

3.    LINQ to XML

Moreover, given that all LINQ syntaxes are built on the same intuitive framework, it’s relatively easy to pick up other syntaxes after you have learned one.