This sample implements the LINQ to SQL feature with the Essential Grouping grid control.
LINQ To SQL
Features:
It generates language-integrated queries for data retrieval, which means that the relational data is represented as objects in these queries. These queries will then be translated into SQL queries that interact with the database.
The tabular results are then translated back into the objects the user defines. These objects can be manipulated in applications. For example, they can be bound to a grid control for display.
Advantages:
Interactive Features:
The class, NorthwindDataContext, plays a role similar to the DataContext class of the .NET framework. This is the main channel by which you retrieve objects from the database and restore changes. It does the translation of LINQ to SQL queries and retranslates the results back to the objects.
This sample allows users to build data relations--such as list item reference, master detail, and many-to-many--using LINQ queries. Below is an example code snippet that represents LINQ queries.
NorthwindDataContext db = NorthwindDataContext.DataContext;
object query = from cust in db.Customers orderby cust.CompanyName select cust;