I\'m trying to perform a LINQ query on a DataTable object and bizarrely I am finding that performing such queries on DataTables is not straightforward. For example:
you can try this, but you must be sure the type of values for each Column
List result = myDataTable.AsEnumerable().Select(x=> new MyClass(){ Property1 = (string)x.Field("ColumnName1"), Property2 = (int)x.Field("ColumnName2"), Property3 = (bool)x.Field("ColumnName3"), });