开发者

LINQPad still cannot find extension method 'Where' after adding System.Data.DataSetExtensions.dll

开发者 https://www.devze.com 2023-01-15 03:00 出处:网络
I have to join results from 2 sprocs in LINQ but got the error message: \'System.Data.DataSet\' does not contain a definition for \'Where\' and no extension method \'Where\' accepting a first argument

I have to join results from 2 sprocs in LINQ but got the error message: 'System.Data.DataSet' does not contain a definition for 'Where' and no extension method 'Where' accepting a first argument of type 'System.Data.DataSet' could be found (press F4 to add a using directive or assembly reference)

However after added the DataSetExtensions the error still appears.

Code:

var c = GetAllGameCategories (123);
var d = GetGameCategories(224开发者_运维百科58);

Var e = c.Where(....);  // Error on this line!

Any help appreciated.


A DataSet is a collection of DataTable objects.
It does not directly contain any data.

You need to call .Where() on the DataTable.
EDIT: If it isn't a typed DataTable, you'll need to call .AsEnumerable() first.

0

精彩评论

暂无评论...
验证码 换一张
取 消