LINQ query on a DataTable

Posted by Calanus on Stack Overflow See other posts from Stack Overflow or by Calanus
Published on 2008-08-14T10:08:27Z Indexed on 2010/05/23 4:10 UTC
Read the original article Hit count: 305

Filed under:
|
|
|

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:

var results = from myRow in myDataTable
where results.Field("RowNo") == 1
select results;

This is not allowed. Any ideas how to get something like this working? I'm amazed that LINQ queries are not allowed on DataTables!

© Stack Overflow or respective owner

Related posts about c#

Related posts about .NET