开发者

System.Data.DataSetExtensions in Mono

I believe the following should work:

IEnumerable<DataRow> d = myDataTable.AsEnumerable();

But it doesn't! I get:

Error CS1061: Type System.Data.DataTable does not contain a definition for AsEnumerable and no extension开发者_开发问答 method AsEnumerable of type System.Data.DataTable could be found (are you missing a using directive or an assembly reference?)

I have System.Data.DataSetExtensions as a reference and this is Mono 3.5 and MonoDevelop 2.4.2. I also have

using System;
using System.Data;
using System.Data.Linq;
using System.Collections.Generic;


I don't know what's your problem and cannot test now but I would definitely start with trying to call extension method directly:

var rows = DataTableExtensions.AsEnumerable(myDataTable);

This will give you some insight on what exactly fails, if this is a namespace, class or method problem.

By the way, there is no Mono 3.5 so you might really be using an old version.
Current version is 2.10.

Mono versions don't go along with .NET version numbers, however you can expect Mono 2.10 to support most of the LINQ goodness (at least for DataSet).

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜