0

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

Mahmoud Gamal
  • 78,257
  • 17
  • 139
  • 164
Michael
  • 13,950
  • 57
  • 145
  • 288

1 Answers1

2

DataTable is not Enumerable.

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

q is IEnumerable<DataRow>.

Hamlet Hakobyan
  • 32,965
  • 6
  • 52
  • 68