Skip to main content

Leverage LINQ in ASP.NET 3.5 Projects



Leverage LINQ in ASP.NET 3.5 Projects

Roger Jennings

ISBN: 978-0-470-25910-8 October 2007 43 Pages

Download Product Flyer

Download Product Flyer

Download Product Flyer is to download PDF in new tab. This is a dummy description. Download Product Flyer is to download PDF in new tab. This is a dummy description. Download Product Flyer is to download PDF in new tab. This is a dummy description. Download Product Flyer is to download PDF in new tab. This is a dummy description.


This Wrox Blox introduces you to Language Integrated Query (LINQ), a .NET 3.5 application programming interface (API) and set of extensions to the Visual Basic and C# languages. First, you get acquainted with LINQ’s Standard Query Operators (SQOs) and new keywords that define the language. Then you use the SQOs to write LINQ expressions in C# 3.0 and VB 9.0 that let you query diverse data types with a single syntax that’s similar to Structured Query Language (SQL). You also discover how to take advantage of a shorthand method-call syntax that chains lambda expressions.

Next you discover how Visual Studio 2008’s primary domain-specific LINQ implementation—LINQ to SQL—persists collections of business objects in SQL Server 200x Tables. You dig into the details of creating an object-oriented data access layer (DAL) with LINQ to SQL’s graphical object/relational mapping (O/RM) tool. You see how to automatically generate entity classes by dragging table nodes from a Server Explorer connection to the O/R Mapper’s and discover how associations between entities called EntityRefs and EntitySets correspond to n:1 and 1:n relationships. You also learn how to use the DAL to bind UI controls on data-driven Web pages with ASP.NET’s new LinqDataSource control that substitutes for the ObjectDataSource control. Complete C# 3.0 and Visual Basic 9.0 project code for the LINQ2SQL2ASP.sln project is available for downloading.

Usage Rights for Wiley Wrox Blox

Any Wrox Blox you purchase from this site will come with certain restrictions that allow Wiley to protect the copyrights of its products. After you purchase and download this title, you:

  • Are entitled to three downloads
  • Are entitled to make a backup copy of the file for your own use
  • Are entitled to print the Wrox Blox for your own use
  • Are entitled to make annotations and comments in the Wrox Blox file for your own use
  • May not lend, sell or give the Wrox Blox to another user
  • May not place the Wrox Blox file on a network or any file sharing service for use by anyone other than yourself or allow anyone other than yourself to access it
  • May not copy the Wrox Blox file other than as allowed above
  • May not copy, redistribute, or modify any portion of the Wrox Blox contents in any way without prior permission from Wiley

If you have any questions about these restrictions, you may contact Customer Care at (877) 762-2974 (8 a.m. - 5 p.m. EST, Monday - Friday). If you have any issues related to Technical Support, please contact us at 800-762-2974 (United States only) or 317-572-3994 (International) 8 a.m. - 8 p.m. EST, Monday - Friday).

The Basics: LINQ to Objects.

Standard Query Operators.

SQOs as Keywords in C# 3.0 and VB 9.0.

Deferred versus Immediate Query Execution.

Object/Relational Mapping with LINQ to SQL.

Mapping Tables to Entity Sets with the LINQ to SQL O/R Designer.

Examining the Generated Classes.

Instantiating the DataContext and Its Object Graph.

Using LINQ to SQL as a Data Access Layer.

The LINQ to SQL Query Pipeline.

Adding, Updating, and Removing Objects.

Detecting Concurrency Conflicts.

Substituting Stored Procedures for Dynamic SQL.

ASP.NET Data Binding with the LinqDataSource Control.

Adding a LinqDataSource to a Page.

Substituting Property Values from EntityRefs for PrimaryKey Values.

Eager-Loading EntityRef Values to Reduce Database Server Traffic.


Updated for RTM Jan 8, 2008