![]() ![]() The LINQ query is functionally equivalent to a string containing a SQL command, but with at least two important differences: The deferred execution method used by LINQ to SQL converts the expression tree into a SQL query that is valid in the underlying relational database. When the foreach loop enumerates data selected by the query, the expression tree is used to generate the corresponding SQL query, using the metadata and information from the entity classes and the referenced DataContext instance. An expression tree maintains a representation of the expression in memory rather than pointing to a method through a delegate. The query variable is initialized with a query expression that forms an expression tree. ![]() Using LINQ to SQL, you can write a simple query such as the following: var query = LINQ to SQL supports Microsoft SQL Server 2008 through SQL Server 2000 and Microsoft SQL Server Compact 3.5. ![]() In other words, you can define a set of objects that represents a thin abstraction layer over the relational data, and you can query this object model by using LINQ queries that are automatically converted into corresponding SQL queries by the LINQ to SQL engine. LINQ to SQL is a LINQ component that provides the capability to query a relational Microsoft SQL Server database, offering you an object model based on available entities. The first and most obvious application of Microsoft Language Integrated Query (LINQ) is in querying an external relational database. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |