Included on the VS 2008
Samples download page are pointers to VB and C# sample packages that
include a cool dynamic query LINQ helper library. Direct pointers to the
dynamic query library (and documentation about it) can be found below:
VB
Dynamic Query Library (included in the \Language Samples\LINQ
Samples\DynamicQuery directory)
C#
Dynamic Query Library (included in the \LinqSamples\DynamicQuery directory)
Both the VB and C# DynamicQuery samples include a source
implementation of a helper library that allows you to express LINQ queries
using extension methods that take string arguments instead of type-safe
language operators. You can copy/paste either the C# or VB
implementations of the DynamicQuery library into your own projects and then use
it where appropriate to more dynamically construct LINQ queries based on
end-user input.