Monday, March 05, 2007


LINQ is an interesting project from Microsoft - it provides a single API for accessing different kind of data sources like databases, XML and even simple string arrays.
Here is a simple example taken from

using System;
using System.Query;
using System.Collections.Generic;

class app {
static void Main() {
string[] names = { "Burke", "Connor", "Frank",
"Everett", "Albert",
"George", "Harris",
"David" };

IEnumerable expr = from s in names
where s.Length == 5
orderby s
select s.ToUpper();

foreach (string item in expr)

Many more examples are available here:

No comments: