Friday, February 02, 2007

LINQ to DataSet Documentation Series

Erick Thompson, an ADO.NET product manager, has started an "Introduction to LINQ to DataSet" series with a Querying DataSets post on the ADO.NET Team Blog. LINQ to DataSets lets you execute Query Expressions against DataTable objects.

LINQ to DataSet enables querying an enumeration of DataRows of untyped or typed DataSets. It also provides DistinctRows, EqualAllRows, UnionRows, IntersectRows, and ExceptRows operators that compare row values instead of the conventional Distinct, EqualAll, Union, Intersect, and Except operators that invoke GetHashCode and Equals methods.

Erick starts with a simple select Query Expression, provides examples of aggregate expressions, and shows how to apply a sort to the result of a function that computes shipping distance.

The examples are C#, but the syntax is simple and thus easy to convert to VB. In future posts, Erick promises to cover "type checking, handl[ing] nulls, and talk about some cool features of VB.NET that make the whole process easier."

LINQ to DataSet was included in the LINQ May 2006 Technical Preview and more extensive documentation is available as "LINQ over DataSet for C# Developers" and "LINQ over DataSet for VB Developers" white papers in Word .doc format.

Update: 2/5/2007: Erick kept his promise and posted LINQ to DataSets Part 2 —Type Safety.

Update: 2/13/2007: Erick posted LINQ to DataSets Part 3 —Nulls.