Description: linqtosql
1. Basics:Language Integrated Query is a set of extensions for c # and Visual Basic languages. It allows you to write C # Or Visual Basic code to query memory data in the same way as a database. It is a feature integrated in. NET programming languages. It has become an integral part of programming languages. During programming, you can get good syntax check, rich metadata, smart sensing, static type, and other advantages of strong language. In addition, it also enables queries to conveniently Query Information in the memory, not just external data sources. LINQ consists of the following parts:
Linq to Objects: Provides queries for any type of C # Memory Objects, such as arrays, lists, and other collection types.
LINQ to SQL: the. NET language Integrated Query Based on relational data. It is used to manage relational data in the form of objects and provides rich query functions. It is built on the integration of SQL-Based Schema definitions in public language systems. When maintaining the relational model expression capability and the performance of direct query and Evaluation of underlying storage, this integration provides strong types of relational data.
LINQ to XML: Perform Xml operations in the System. XML. LINQ namespace. Uses efficient, easy-to-use, in-memory XML tools to provide XPath/XQuery functions in the host programming language.
2. Usage:
The query expression must start with the from clause and end with the select or group clause. Between the first from clause and the last select or group clause, a query expression can contain one or more of the following optional clauses: where, orderby, join, let, or even additional from clause. You can also use the into keyword to make the results of join or group Clauses Act as the source for adding query clauses to the same query expression.
Here is a simple example (getting all users ):
Var allUsers = from c in Users
Select c;
3. Link:
Quick learning and using the Linq channel: http://www.cnblogs.com/knowledgesea/p/3897665.html