Wednesday, September 11, 2013

LINQ : An Introduction

LINQ is an acronym for “Language Integrated Query.” It’s been around since Visual Studio 2008 but in the works far in advance of that; however, many companies are just now using it for the first time. It is a programming model developed by Microsoft to allow developers to query several types of objects as if they were querying a SQL database. For example, developers can now query for a textbox on a form with the ease of querying for a row in a database table – often, with less overhead.

The syntax is similar to SQL except that the clauses are ordered differently. For example, note the following LINQ query:

var queryProduct =
from p in products
select p.ProductName;


Common objects queryable by LINQ are enumerable classes, arrays, datasets, and XML documents.

No comments:

Post a Comment