Querying the Database

This group of topics describes how to develop and execute queries in LINQ to SQL projects.

In This Section

How to: Query for Information
Briefly shows how LINQ to SQL queries are basically the same as LINQ queries generally.

How to: Retrieve Information As Read-Only
Describes how to increase query performance when no change to the data is planned.

How to: Control How Much Related Data Is Retrieved
Describes how to control which related data is retrieved together with the main target.

How to: Filter Related Data
Describes how to retrieve related data by using a sub-query.

How to: Turn Off Deferred Loading
Describes how to turn off deferred loading.

How to: Directly Execute SQL Queries
Describes how to submit queries by using SQL language.

How to: Store and Reuse Queries
Describes how to compile a query one time but use it multiple times with different parameters.

How to: Handle Composite Keys in Queries
Describes how to include more than one column in a query where the operator takes only a single argument.

How to: Retrieve Many Objects At Once
Describes how to use LoadWith.

How to: Filter at the DataContext Level
Describes another use of LoadWith.

Query Examples
Provides many examples of queries.