Content area
Full Text
Still a powerful tool for working with SQL Server data
A couple of years ago I wrote an initial introduction to Language- Integrated Query (LINQ) to SQL see "LINQ to Your SQL Server Data," www.sqlmag.com, InstantDoc ID 98205). One of LINQ's original goals was lo lei application programmers replace the use of T-SQL with Visual Studio and LINQ queries thai could be converted into T-SQL-based queries. LlNQ to SQL soon fell by the wayside as Microsoft pushed its ADO .NET Entity Framework as the up-and-coming data access technology. However. LINQ still has a place in the application development architecture, and Microsoft continues to support the LINQ to SQL subset albeit with few, if any, enhancements.
Although Microsoft is no longer moving forward with the specific subset of LINQ that focuses on SQL Server and ihe integraiion with a graphical table designer, the core of LINQ to SQL is slul supported. In this article I review the core features of LINQ to SQL and discuss some of the new roles of LINQ in the typical application architecture. I take a look at new LINQ features, such as Parallel LINQ and the use of LINQ in SharePoint.
LINQ Capabilities
Although Microsoft isn't moving forward with the portion of LINQ that generates T-SQL code to run againsi SQL Server, the company still supports LlNQ for processing query results. LINQ tends to be referred to in the context of a second technology group - the provider - such as LINQ to XML, LINQ to SQL. or LlNQ Io Entities. Each of these categories builds on the core LINQ syntax, and the differences between categories (e.g., LINQ to DataScts versus LINQ to SQL) can be subtle. A developer might initially suggest using LINQ to SQL even if he or she actually means LINQ to Entities or LINQ to DalaSets. Some developers will continue leveraging LINQ to SQL as a familiar tool in certain situations, although LINQ's larger focus is on data already returned from SQL Server. The area in which LINQ continues to have a robust role is in processing data in the form of entities and the results from processing stored procedures againsi a database.
As Figure I shows, LINQ provides six standard methods for accessing data...