Murach's ADO.NET 4 Database Programming
with C# 2010

How to use LINQ

In this chapter, you'll learn to use LINQ, a feature that allows you to query a data source using constructs that are built into the C# language. This chapter focuses on how to use LINQ to SQL to query databases...and shows you the benefits of doing that instead of coding SQL commands.

Chapter 17 How to use LINQ
An introduction to LINQ 606
Common LINQ query operators 606
The three stages of a query operation 608
How to code query expressions 610
How to identify the data source for a query 610
How to filter and sort the results of a query 612
How to select fields from a query 614
How to assign an alias to the result of a calculation 616
How to join data from two or more data sources 618
How to group query results 620
How to use LINQ to SQL 622
The basic components of an object model 622
How to start a new object model 624
How to create entity classes 624
How to retrieve data from a single table 626
How to query across relationships 628
How to use bound controls with LINQ to SQL 630
How to create an object data source from an entity class 630
How to bind controls 632
A Vendors Invoices application 634
The user interface 634
The object model 634
The code for the Vendor Invoices form 636




Murach's ADO.NET 4 with C# 2010

Learn more about this book

View the table of contents


More about the eBook



Our 100% Guarantee

First, try our books for 90 days. Then, if you aren't completely convinced that our books are the best ones you've ever used, you can return them for a prompt refund...no questions asked.