Language Integrated Query: Difference between revisions

Content deleted Content added
m archive link repair, may include: archive.* -> archive.today, and http->https for ghostarchive.org and archive.org
Line 123:
 
====LINQ to SQL (formerly called DLINQ)====
The LINQ to SQL provider allows LINQ to be used to query [[Microsoft SQL Server]] databases, including [[SQL Server Compact]] databases. Since SQL Server data may reside on a remote server, and because SQL Server has its own query engine, LINQ to SQL does not use the query engine of LINQ. Instead, it converts a LINQ query to a [[SQL]] query that is then sent to SQL Server for processing.<ref>{{cite web | url = http://www.hookedonlinq.com/LINQtoSQL5MinuteOverview.ashx | title = LINQ to SQL | access-date = 2007-11-30 | archive-url = https://archive.istoday/20130125231336/http://www.hookedonlinq.com/LINQtoSQL5MinuteOverview.ashx | archive-date = 2013-01-25 | url-status = dead }}</ref> However, since SQL Server stores the data as [[relational database|relational data]] and LINQ works with data encapsulated in objects, the two representations must be [[Object-Relational mapping|mapped]] to one another. For this reason, LINQ to SQL also defines a mapping framework. The mapping is done by defining classes that correspond to the tables in the database, and containing all or a subset of the columns in the table as data members.<ref name="ltos">{{cite web | url = http://msdn2.microsoft.com/hi-in/library/bb425822.aspx | title = LINQ to SQL: .NET Language-Integrated Query for Relational Data | access-date = 2007-11-30}}</ref> The correspondence, along with other [[relational model]] attributes such as [[primary key]]s, are specified using LINQ to SQL-defined [[attribute (computing)|attributes]]. For example,
 
<syntaxhighlight lang="csharp">
Line 142:
 
====LINQ to DataSets====
Since the LINQ to SQL provider (above) works only with [[Microsoft SQL Server]] databases, in order to support any generic database, LINQ also includes the LINQ to DataSets. It uses ADO.NET to handle the communication with the database. Once the data is in ADO.NET Datasets, LINQ to DataSets execute queries against these datasets.<ref>{{cite web | url = http://www.hookedonlinq.com/LINQtoDatasets.ashx | title = LINQ to DataSets | access-date = 2007-11-30 | archive-url = https://archive.istoday/20130125171110/http://www.hookedonlinq.com/LINQtoDatasets.ashx | archive-date = 2013-01-25 | url-status = dead }}</ref>
 
==Performance==