LINQ to DataSet, DataTable.AsEnumerable() not recognized

前端 未结 3 889
抹茶落季
抹茶落季 2021-01-01 10:32

I am brand new to LINQ and am trying to query my DataSet with it. So I followed this example to the letter, and it does not work.

I know t

3条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-01 11:07

    While the class holding the extensions is in the System.Data namespace, it's located in an assembly that isn't added to your project by default. Add a reference to System.Data.DataSetExtensions to your project and it should be ok. Remember that, even after you've added the reference, any class that expects to use the extension methods defined in the class will need to have a using statement for System.Data as well.

提交回复
热议问题