SQL Server and LINQ

What is LINQ?

Language-Integrated Query (LINQ) is a set of features in Visual Studio 2008 that extends powerful query capabilities to the language syntax of C# and Visual Basic.

LINQ introduces standard, easily-learned patterns for querying and updating data, and the technology can be extended to support potentially any kind of data store. Visual Studio 2008 includes LINQ provider assemblies that enable the use of LINQ with .NET Framework collections, SQL Server databases, ADO.NET Datasets, and XML documents.  

In a nutshell, LINQ will offer an integrated programming experience, enabling developers to query object, relational and XML data directly from within C# and Visual Basic – without having to use multiple programming languages.

Using one language to unify all of the programming domains – objects, relational data and XML – makes the LINQ Project a truly powerful and innovative solution, one that provides yet another advantage to using the .NET Framework.

Why LINQ?

One of the main issues developers face is the difficulty of creating data-rich applications, a difficulty that arises from the tremendous differences between query languages used to access data and programming languages commonly used to write applications.

To reduce complexity for developers and help boost their productivity, Microsoft developed the Language Integrated Query (LINQ) Project, a set of language extensions to the C# and Visual Basic programming languages that extends the Microsoft .NET Framework by providing integrated querying for objects, databases and XML data.

Using LINQ, developers will be able to write queries natively in C# or Visual Basic without having to use other languages, such as Structured Query Language (SQL) or XQuery, a query language for accessing XML data.

There are five implementations of LINQ that enable you to access data:

LINQ to SQL supports rapid development of applications that query all editions of Microsoft SQL Server by using programmatic objects that map directly to database objects in SQL Server schemas, for example, tables, views, stored procedures, and user defined functions.

LINQ to Entities supports a more flexible mapping of objects to relational tables, views, stored procedures, and user defined functions. You can use LINQ to Entities to access data from SQL Server and other relational databases through extended ADO.NET data providers.

LINQ to DataSet introduces rich query capabilities on top of both regular and typed DataSets. This enables you to create and query joins between DataTables in a DataSet.

LINQ to XML is an in-memory XML programming application programming interface (API) that is designed to take advantage of the latest .NET Framework language innovations.

LINQ to Object empowers you to run LINQ queries against in-memory objects. This enables you to use in-memory data in the same way that you use data from any other source.