LINQ to ADO.NET

Summary

There are three separate ADO.NET Language-Integrated Query (LINQ) technologies:

  • LINQ to SQL
  • LINQ to DataSet
  • LINQ to Entities

LINQ to SQL

LINQ to SQL is used to query relational databases such as Microsoft SQL Server. It translates language-integrated queries in the object model into SQL and sends them to the database for execution. When the database returns the results, LINQ to SQL translates them back into objects that you can manipulate.

LINQ to SQL includes support for stored procedures and user-defined functions in the database, and for inheritance in the object model.

LINQ to SQL implements the IQueryable interface to convert query expressions into Expression trees, which it transforms into SQL statements.

LINQ to DataSet

LINQ to DataSet makes it easier and faster to query over data cached in a DataSet object. Specifically, LINQ to DataSet simplifies querying by enabling developers to write queries from the programming language itself, instead of by using a separate query language.

LINQ to DataSet can also be used to query over data that has been consolidated from one or more data sources.

LINQ to Entities

LINQ to Entities is a Microsoft ORM solution, allowing developers to use Entities to declaratively specify the structure of business objects and use LINQ to query them.