LINQ Resources

LINQ (Language Integrated Query) is one of the most promising technologies for Microsoft®’s .NET.

Here are some great resources for those interested in learning more about this generic data query API:

  • LINQ/C# Learning Guide – Quick look at the LINQ extensions and the upcoming release of C# 3.0 in general
  • LINQ in Action – Learn about LINQ, LINQ to SQL (DLINQ) and LINQ to XML (XLINQ)
  • Hooked on LINQ – Developers’ Wiki for .NET Language Integrated Query
  • LINQDev – Dedicated site to Language Integrated Query development

Great LINQ Resources

Right now there are two extensions for .NET that I find very interesting.

The first one is Language INtegrated Query (LINQ) and the other one is the Atlas Toolkit.

For those looking for more information about LINQ, visit LINQ Project Overview at MSDN, and Scott Guthrie’s last post where he shares the code samples and slides from his TechEd LINQ Talk in Australia.

LINQ’s benefits

LINQ’s benefits include, most significantly, a standardised way to query not just tables in a relational database but also text files, XML files, and other data sources using identical syntax. A second benefit is the ability to use this standardised method from any .NET-compliant language such as C#, VB.NET, and others.

LINQ in action

The following snippet illustrates (in C#) a simple LINQ code block, using the Northwind database as its target. To see LINQ at work, we’ll use a simple C# 3.0 program that uses the standard query operators to process the contents of an array.

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

class app {
  static void Main() {
    string[] names = { "Alpha", "Brian", "Connie", "David",
                       "Frank", "George",
                       "Harry", "Inigo" };

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

    foreach (string item in expr)

This program delivers this output:


Using LINQ with ASP.NET

Scott Guthrie, Microsoft’s ASP.NET and Atlas development guru, has posted a two-part article on using the Language Integrated Query, or LINQ, within ASP.NET projects.

  • Part 1 how to create the ASP.NET page using LINQ, using rich collections of strings, refactoring collections, working with .NET Standard Query Operations and using Anonymous types.
  • Part 2 details about DLINQ, or LINQ for databases, such as creating a DLINQ-enabled object model, hierarchical binding and basic pagination.

And more is on the way:

In my next few LINQ posts I’ll show how we will be able to build on top of the concepts I demonstrated above to easily add sorting, in-line editing, deleting, and selection support over our customer data – and also show how to easily Ajax enable it with Atlas.