by Administrator
20. May 2009 12:52
LINQ (Language Integrated Query) is a set of extensions for the C# and Visual Basic languages. It
allows you to write C# or Visual Basic code that manipulates in-memory data in much the same way
you query a database.
Technically, LINQ defines about 40 query operators, such as select, from, in, where, and orderby
(in C#). These operators allow you to code your query. However, there are various types of data on
which this query can be performed, and each type of data requires a separate flavor of LINQ.
The most fundamental LINQ flavor is LINQ to Objects, which allows you to take a collection
of objects and perform a query that extracts some of the details from some of the objects. LINQ to
Objects isn’t ASP.NET-specific. In other words, you can use it in a web page in exactly the same way
that you use it in any other type of .NET application.
Along with LINQ to Objects is LINQ to DataSet, which provides similar behavior for querying an
in-memory DataSet object, and LINQ to XML, which works on XML data. Third-party developers and
tool providers are certain to create more LINQ providers. However, the flavor of LINQ that’s attracted
the most attention is LINQ to SQL, which allows you to use the LINQ syntax to execute a query against
a SQL Server database. Essentially, LINQ to SQL creates a properly parameterized SQL query based on
your code, and executes the query when you attempt to access the query results. You don’t need to
write any data access code or use the traditional ADO.NET objects.
LINQ to Objects, LINQ to DataSet, and LINQ to XML are features that complement ASP.NET,
and aren’t bound to it in any specific way. However, ASP.NET includes enhanced support for LINQ
to SQL, including a data source control that lets you perform a query through LINQ to SQL and bind
the results to a web control, with no extra code required

ebc5260f-4bbc-4375-a01d-53cc75474874|0|.0
Tags: linq