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。 

For more information, see Introduction to LINQ。 Also see the LINQ General Programming Guide, which contains detailed information about how to use LINQ technologies。

There are three separate ADO。NET Language-Integrated Query (LINQ) technologies: LINQ to DataSet ,LINQ to SQL, and LINQ to Entities。 LINQ to DataSet provides richer, optimized querying over the DataSet and LINQ to SQL enables you to directly query SQL Server database schemas, and LINQ to Entities allows you to query an Entity Data Model。 

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 IEnumerable collection, both when you query and when you update。 Full IntelliSense support is provided for writing queries against those collections。 

The following diagram provides an overview of how the ADO。NET LINQ technologies relate to high-level programming languages and LINQ-enabled data sources。

The following sections provide more information about LINQ to DataSet, LINQ to SQL, and LINQ to Entities。

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。 

 LINQ to Entities 

Most applications are currently written on top of relational databases。 At some point, these applications will need to interact with the data represented in a relational form。 Database schemas are not always ideal for building applications, and the conceptual models of application are not the same as the logical models of databases。 The Entity Data Model is a conceptual data model that can be used to model the data of a particular domain so that applications can interact with data as objects。

Through the Entity Data Model, relational data is exposed as objects in the 。NET environment。 This makes the object layer an ideal target for LINQ support, allowing developers to formulate queries against the database from the language used to build the business logic。 This capability is known as LINQ to Entities。。

上一篇:齿轮平行转子系统英文文献和中文翻译
下一篇:电子商务英文文献及中文翻译

未加筋的低屈服点钢板剪...

会计师事务所任期与审计...

信息系统开发与数据库开...

升式单位上升操作结构英文文献和中文翻译

机器人学入门力学与控制英文文献和中文翻译

园林植物景观的园林绿化...

基卡气体管道PLEM结构的原...

LiMn1-xFexPO4正极材料合成及充放电性能研究

新課改下小學语文洧效阅...

互联网教育”变革路径研究进展【7972字】

我国风险投资的发展现状问题及对策分析

ASP.net+sqlserver企业设备管理系统设计与开发

麦秸秆还田和沼液灌溉对...

安康汉江网讯

张洁小说《无字》中的女性意识

老年2型糖尿病患者运动疗...

网络语言“XX体”研究