DataTable does not contain definition for AsEnumerable

前端 未结 6 1887
轮回少年
轮回少年 2020-11-30 06:12

Using linq to query a datatable returns the following error: CS0117: \'DataSet1.map DataTable\' does not contain a definition for \'AsEnumerable\'

Project include

6条回答
  •  萌比男神i
    2020-11-30 07:01

    I got this error message: 'System.Data.DataTable' does not contain a definition for 'AsEnumerable' and no extension method 'AsEnumerable' accepting a first argument of type 'System.Data.DataTable' could be found (are you missing a using directive or an assembly reference?)

    Added

    using System.Data;
    

    Added "System.Data.DataSetExtensions" to the References section. It resolved the problem.

提交回复
热议问题