Language-Integrated Query (LINQ) enables developers to form set-based
queries in their application code, without having to use a separate
query language. You can write LINQ queries against various enumerable
data sources (that is, a data source that implements the IEnumerable
interface), such as in-memory data structures, XML documents, SQL
databases, and DataSet objects. Although these enumerable data sources
are implemented in various ways, they all expose the same syntax and
language constructs. Because queries can be formed in the programming
language itself, you do not have to use another query language that is
embedded as string literals that cannot be understood or verified by
the compiler. Integrating queries into the programming language also
enables Visual Studio programmers to be more productive by providing
compile-time type and syntax checking, and IntelliSense. These features
reduce the need for query debugging and error fixing.
LINQ to ADO.NET consists of two separate technologies: LINQ to DataSet
and LINQ to SQL. LINQ to DataSet provides richer, optimized querying
over the DataSet and LINQ to SQL enables you to directly query SQL
Server database schemas.
Transferring data from SQL tables into objects in memory is often
tedious and error-prone. The LINQ provider implemented by LINQ to
DataSet and LINQ to SQL converts the source data into IEnumerable-based
object collections. The programmer always views the data as an
IEnumerableIntelliSense support is provided for writing queries against
those collections. collection, both when you query and when you update.
Full
The following sections provide more information about LINQ to DataSet and LINQ to SQL.
LINQ to DataSet
The DataSet is a key element of the disconnected programming model that
ADO.NET is built on, and is widely used. LINQ to DataSet enables
developers to build richer query capabilities into DataSet by using the
same query formulation mechanism that is available for many other data
sources. For more information, see LINQ to DataSet.
LINQ to SQL
LINQ to SQL is a useful tool for developers who do not require mapping
to a conceptual model. By using LINQ to SQL, you can use the LINQ
programming model directly over existing database schema. LINQ to SQL
enables developers to generate .NET Framework classes that represent
data. Rather than mapping to a conceptual data model, these generated
classes map directly to database tables, views, stored procedures, and
user-defined functions.
With LINQ to SQL, developers can write code directly against the
storage schema using the same LINQ programming pattern as in-memory
collections and the DataSet, in addition to other data sources such as
XML. For more information, see LINQ to SQL.
Bùi Ngọc Anh
- Microsoft Urlscan Filter v3.0 - (22/08)
- Visual Studio 2008 SDK Version 1.1 - (22/08)
- Tạo bản quyền trong MS Word - (12/08)
- Điều gì làm nên sức mạnh của ngành phần mềm Ấn Độ? - (25/07)
- Laptop mini HP 2133 Mini-Note - (21/07)
- Visual Studio.Net - LINQ Video Series Samples - (16/07)
- XML Web Services Basics - (16/07)
- Thủ thuật gỡ USB nhanh và an toàn - (12/07)
- Tối ưu hóa Firefox (phần 2) - (04/07)
- Tối ưu hóa Firefox (phần 1) - (04/07)





