.NET 2 does not have LINQ. You can use LINQBridge , which may or may not include the AsEnumerable() extension method for the DataTable . If so, you can simply use Cast<DataRow>() instead, optionally via an explicit range variable:
DateTime minDate = (from DataRow f in dt.AsEnumerable() select f.Field<DateTime>("Timestamp")).Min();
You will also need a method to extend Field<T> to a DataRow . You could probably write this yourself, though if it's not part of LINQBridge.
Just to make it clear - none of this will work nicely if you are also using Visual Studio 2005, because you need C # 3 functions for lambda expressions, extension methods, etc.
Is it possible to upgrade to .NET 3.5? That would make life so much easier ...
source share