linq, selecting columns as IEnumerable<DataRow>

Posted by joe on Stack Overflow See other posts from Stack Overflow or by joe
Published on 2010-04-20T08:50:14Z Indexed on 2010/04/20 8:53 UTC
Read the original article Hit count: 301

Filed under:
|
|
|

how can i do in linq:

IEnumerable<DataRow> query = 
        from rec in dt.AsEnumerable() 
        where rec.Field<decimal>("column2") == 1 && foo(rec.Field<decimal>("column1"))
        select new {
            column1 = rec.Field<decimal>("column1"),
            column2 = rec.Field<decimal>("column2"),
            column3 = rec.Field<decimal>("column3")}  ;

this does not work. Im trying to select some columns as new datatable then join it later with some other datatable.

© Stack Overflow or respective owner

Related posts about LINQ

Related posts about c#