How to LINQ? Part-1: Understanding the basics of LINQ

What is LINQ?

 

One of the key additions in .NET Framework 3.5 is LINQ (Language Integrated Query).  In the early days it was a little confusing for many since it is a different model. Here is an attempt to put it in a simple way and see what the capabilities that LINQ provide are.

 

LINQ adds powerful query capabilities to programming language syntax (C#, Visual basic). It provides some patterns for querying and updating data from different data sources.

 

What does that mean?  With the introduction of LINQ, “query” becomes a basic language construct, just like control structures, classes, methods etc.

 

LINQ Providers

 

As mentioned above, the query can be against different data sources. It can be used with .NET framework objects, SQL Databases, ADO.NET Datasets and XML documents. These different providers define different flavours of LINQ that are listed below:

 

  1. LINQ to Objects
  2. LINQ to XML
  3. LINQ to SQL
  4. LINQ to Datasets

Before getting into details of these, we should understand the basic query expressions which I will focus in the next blog in this series.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s