This section provides Visual Basic and C# examples of typical LINQ to SQL queries. Developers using Visual Studio can find many more examples in a sample solution available in the Samples section. For more information, see Samples.
|db is often used in code examples in LINQ to SQL documentation. db is assumed to be an instance of a Northwind class, which inherits from DataContext.|
In This Section
- Determine if Any or All Elements in a Sequence Satisfy a Condition
- Provides examples of using All and Any.
- Formulate Joins and Cross-Product Queries
- Provides examples of using foreign-key navigation in the from, where, and select clauses.
- Formulate Projections
- Provides examples of combining select with other features (for example, anonymous types) to form query projections.
Copyright © 2012 by Microsoft Corporation. All rights reserved.