Learning Guide

LINQ Learning Guide: LINQ to SQL

 

   TABLE OF CONTENTS   

 

   LINQ Quick Start
   LINQ and Visual Studio 2008's new language features
   LINQ Providers
   LINQ and Web applications
   LINQ to Objects
   LINQ to XML
   LINQ to SQL
   LINQ to DataSet
   LINQ to Entities
   Third-party LINQ Implementations
    VISIT OUR OTHER LEARNING GUIDES

 

LINQ to SQL

The most grandiose LINQ implementation is LINQ to ADO.NET, which itself is divided into LINQ to SQL, LINQ to DataSet and LINQ to Entities (which refers to a forthcoming release of the ADO.NET Entity Framework.

This section of the LINQ Learning Guide focuses on LINQ to SQL, which of the five LINQ implementations has garnered the most attention. It includes tutorials for building and executing LINQ to SQL and a special section that examines LINQ to SQL performance. From here, the next section of our learning guide looks into LINQ to DataSet.

LINQ to SQL five-minute overview (Hooked on LINQ)
This page offers an introduction to the many ways one can use LINQ to SQL.

Video: LINQ to SQL in fewer than 15 minutes (Jay Kimble)
This video covers setting up Visual Studio to work with LINQ to SQL, executing a select from the database and saving your changes back to the database. (It was initially intended to last but 10 minutes, but that proved too ambitious for the author.)

"How do I with LINQ" video series (Microsoft)
These seven videos, hosted on Microsoft's ASP.NET site, cover important LINQ to SQL topics like the data model, the use of stored procedures and the LinqDataSource.

Learning LINQ to SQL using Visual Basic 2008 (Jagadish Chararji)
As the title of the entry indicates, this blogger decided to build an application (in this case, an ASP.NET 3.5 Web site project), plug in several SQL SELECT statements and see how they could be expressed using LINQ.

Scott Guthrie's LINQ to SQL series (Scott Guthrie)
Microsoft's Web development guru posted a nine-part blog series about LINQ to SQL. In the interest of conserving space, we have linked only to Part 9 (as that links to every entry in the series). Read the series in its entirety to learn about Data Model Classes, the ASP:LinqDataSource Control and more.

How to implement a many-to-many relationship using LINQ to SQL (Mitsuru Futura)
Many-to-many relationships are critical because, as this blogger puts it, "a single product can belong to many orders and a single order can contain many products." LINQ to SQL has difficulty defining such complex relationships, for some reason, so this blogger created a manual shortcut that does the job. (Scroll down to the comments to get the version that works with the RTM release of Visual Studio 2008.)

Video: LINQ to SQL Pipeline (Charlie Calvert)
In this video, Luca Bolognese and Matt Warren explain the SQL Pipeline, which transforms a LINQ query into SQL and returns a result to the user.

Video: LINQ to SQL and the OR Designer in Visual Studio 2008 (Microsoft)
In this video, Young Joo of the Visual Basic team demonstrates the use of LINQ to SQL with regards to relational data in a typical client-server scenario.

Connecting to a database with LINQ to SQL and C# (Charlie Calvert)
This post focuses on the LINQ to SQL OR Designer and how it can map between objects in a database and classes in code.

PLINQO: LINQ to SQL extended (InfoQ)
CodeSmith's PLINQO, or Professional LINQ to Objects, is actually a set of templates for use with LINQ to SQL functionality in Visual Studio 2008. Among other things, CodeSmith's templates include a business rules engine and a manager class, both of which LINQ to SQL lacks.

Below we feature resources that address performance issues with applications that run LINQ to SQL queries.

LINQ to SQL Performance, Part 1 (Rico Mariani)
This blogger built a rather "harsh test environment" in which to test the performance of LINQ to SQL, or queries to a SQL Server database. This section introduces that test environment and reviews the metrics that came up when performance was first monitored.

LINQ to SQL Performance, Part 2
In this section, Mariani discovers the problem -- "It was the per-query costs that seemed to be the greatest trouble spot in the then-current profiles."

LINQ to SQL Performance, Part 3
This section describes how to tweak entity management and data binding within the query.

LINQ to SQL Performance, Part 4
This section provides the code syntax for the new build and demonstrates the performance gains to be found in compiled queries.

LINQ to SQL Performance, Part 5
This section wraps things up by covering the major steps in running a query and in conducting insert and update cases. Mariani also tries to explain how performance worked as well as it did and how other database programmers can see the same results.

LINQ to SQL and VS 2008 performance (David Hayden)
This blogger, who has penned several LINQ to SQL tutorials, wonders if LINQ queries do, in fact, perform better than does the SqlDataAdaptor.

LINQ to SQL: Sweet query and performance control (David Hayden)
Hayden was a little disappointed with LINQ to SQL performance, particularly when it came to heavy columns -- until he discovered "lazy loading," which ensures that heavy columns and other fields are not duplicated.

Creating data access layer using LINQ to SQL: Stored procedures support (David Hayden)
Here Hayden discusses the use of stored procedures as an alternative to LINQ to SQL queries. Stored procedures may be a consideration if a programmer has performance concerns.

 


*** Go on to the next section of the LINQ Learning Guide: LINQ to DataSet

This was first published in February 2008

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to: