Wednesday, December 07, 2005

LINQ - first look

MVPs have been chomping at the bit to release info about a new bit of technology - LINQ. Well, Microsft has finally made it public, so here is the scoop. First of all what is LINQ? It is Just an acronym for Language Integrated Query. What this means is that starting in C# 3.0 and VB 9, you'll be able to write data queries inline with the code as if it were a natural part of the language.

string[] words = { "cherry", "apple", "blueberry" };

var sortedWords =
from w in words
orderby w
select w;

The variable sortedWords then contains the resulting data.

Standard LINQ is the base technology that lets you query any enumerable data structure. DLINQ is used to query databases and XLINQ is used to query XML.

LINQ is Microsoft's answer (or rather Anders Heilsjberg's answer) to the much discussed issue of impedance mismatch.

We sure could use the advantages of integrating SQL schema into CLR metadata. One interesting aspect of LINQ is that it not only integrates SQL Server into the CLR through DLINQ but is also used for just about any type of structured data that we use in our programs - be it objects, string arrays, XML data etc.

LINQ also has a predecessor called (C Omega) which was also intended to reduce the "impedance mismatch" between the Object-oriented world and the relational world. But i guess it didn't see the light of the day or it was abandoned and is still lurking around somewhere in the Microsoft Research Labs

Anyway, if you want more info on LINQ, go here:


Post a Comment

<< Home

Web site analytics Web site analytics