Michael
Michael

Reputation: 13616

Linq To DataSet getting error

In my WinForm project, I try to access to the table in DataSet with help of LINQ.

      DSObjectData lDataSetObject; // DSObjectData -Strongly typed DataSet

       var q = from contour in lDataSetObject.Contour
               select contour;

But on select operator I get this error:

Cannot convert lambda expression to type 'string' because it is not a delegate type

Upvotes: 0

Views: 117

Answers (1)

Hamlet Hakobyan
Hamlet Hakobyan

Reputation: 33381

DataTable is not Enumerable.

var q = from contour in lDataSetObject.Contour.AsEnumerable()
               select contour;

q is IEnumerable<DataRow>.

Upvotes: 2

Related Questions