Objects stand alone, existing as long as they are still referenced by another object.
Rows exist as elements of tables, vanishing as soon as they are removed.
LINQ to SQL, a component of Visual Studio Code Name "Orcas", provides a run-time infrastructure for managing relational data as objects without losing the ability to query.
It does this by translating language-integrated queries into SQL for execution by the database, and then translating the tabular results back into objects you define.
The samples in this document are shown in both C# and Visual Basic; LINQ to SQL can be used with the LINQ-enabled version of the Visual Basic compiler as well.
The first step in building a LINQ to SQL application is declaring the object classes you will use to represent your application data. We will start with a simple class Customer and associate it with the customers table in the Northwind sample database.
How information is represented—the data model—is quite different between the two.
The following chapters provide an overview of how LINQ to SQL can be used to perform common database-related tasks.
It is assumed that the reader is familiar with Language-Integrated Query and the standard query operators. Any language built to provide Language-Integrated Query can use it to enable access to information stored in relational databases.
Your application is then free to manipulate the objects while LINQ to SQL stays in the background tracking your changes automatically.
Together, the LINQ to SQL run-time infrastructure and design-time tools significantly reduce the workload for the database application developer.