M6.Net ASP.Net, ASP and PHP hosting Provider
Register your domain

M6.net articles

asp.net windows web hosting asp

Language Integrated Query (LINQ)

LINQ is a Microsoft .NET Framework component that adds native data querying capabilities to .NET languages using syntax similar to SQL.

LINQ defines a set of query operators that can be used to query enumerable classes, XML, relational database, and third party data sources. While it allows any data source to be queried, it requires that the data must be encapsulated as objects. Queries written using the query operators are executed either by the LINQ query processing engine or, via an extension mechanism, handed over to LINQ providers which either implement a separate query processing engine or translate to a different format to be executed on a separate data store (such as on a database server as SQL queries). The results of a query are returned as a collection of in-memory objects that can be enumerated.

Some LINQ operators

  • Select - can be used similar to the select method in SQL
  • Where – filter the results selected
  • OrderBy – way to order the results
  • GroupBy – similar to SQL "group by"
  • Distinct – only returns unique rows