문제

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

도움이 되었습니까?

해결책

DataTable is not Enumerable.

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

q is IEnumerable<DataRow>.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top