Overview
I thought of gathering some information about Microsoft's latest querying technology and summerising that information here so that readers of this Blog and the members of the .NetFoundry user group will benefit from it. There's lot to talk about LINQ. Therefore I'll split this article into several parts and publish separately. Since this is the first article about LINQ in the user group I'll start with an introductory and would try to give a glimps in to LINQ.
What is LINQ?
-
LINQ - Language INtegrated Query
-
Is an extension to .Net compliant languages like C#, VB.Net and others for general purpose querying
-
Object based, language integrated way to query over data no matter from where that data came from or generated
-
Is a universal querying mechanism where we can query objects, collections, text files, relational data and XML
-
Could retrieve data from any object that implements the
IEnumerable<T> interface
-
Is an integral part of Visual Studio 2008 and could incorporate with Visual Studio 2005 as an additional
CTP download
-
Used to overcome the impedance mismatch between programming languages and database
-
LINQ has been separated into three main areas. They are,
-
Highly extensible
LINQ Architecture
The architecture of LINQ is depicted below and it is self explanatory.

Advantages of using LINQ
-
There's a common syntax for querying any data source mentioned above. This eliminates the one source - one query language concept. I.e. for example Relational Data -> SQL, XML Documents -> XPath and .Net objects -> .Net built in operators such as foreach.
-
Able to use LINQ with .Net 1.x and .Net 2.0 objects
-
Able to extend LINQ to support new classes and technologies
-
Integrated to the .Net framework thereby accessible from any .Net compliant language (native code) and make use of their stregths and compile time syntax checking. E.g. it inherits the new C# language features like,
-
Avoids dynamic creation of string queries within native code (e.g. C#) and thereby avoiding the disadvantage of not having compile time checking of queries. I.e. eliminating mixture of native code and none native code. This also saves time on creating a dynamic query.
-
Intelli sense is available in Visual Studio
-
Designer support
-
Gives more power to the front-end programmer to manipulate data
-
Shorter learning curve
-
Could access stored procedures and user defined functions in a relational database
Disadvantages
-
Mainly focus on or support SQL Server but not Oracle or other databases such as MySQL, DB2. Others have to provide their own provider model or extension.
-
Lack of "Left/ Right" keywords in a Join even though the objectives are met
-
Data manipulation logic/code is written in the application rather than the DB end in LINQ to SQL.
-
Database programmers would be jobless (Joke!)

Summery
LINQ is a common method of accessing objects that implements IEnumerable <T> interface, relational data, text files and XML. This gives an extension and a cool new addition to the strength of .Net compliance languages even though there are several disadvantages of it.
Rule Of Thumb
I'm pretty sure LINQ will not replace classic SQL, T/SQL or PL/SQL but it will extend the data manipulation capability of the programmer. Its a pretty cool tool to be in our tool box. We as the programmers must decide when to use it and when not to.
References
MSDN - 101 LINQ Samples
The LINQ project
ScottGu's Blog
The evolution of LINQ and its impact on the design of C#
Rediscovering IEnumerable<T> - by Tomas Restrepo
What is LINQ? by Saquib Ullah
Dedicated website for LINQ
Is LINQ the future of database development? - by Arthur Fuller