LINQ to dataset
Posted: Thu Sep 05, 2013 2:11 am
Hi there,
I am working on a TxA- and -B- Series Target programming an application with database connection. So i thought about using a dataset and the "LINQ to Dataset" functionality. So I wrote the following code:
DataSet ds;
...
var result = ds.Tables["tabRecipe"].AsEnumerable()
.Where(row => row.IDRecipe == iIDRecipe && row.Priority >= iStepPriority)
.OrderBy(row => row.Priority)
.FirstOrDefault();
...
But when I'm trying to compile, the following error comes on:
"System.Data.DataTable" has no definition for "AsEnumerable", and there was no extension method "AsEnumerable...
The Microsoft .net documentation about LINQ in the .net cf says that LINQ to Dataset is also working on cf, and also the "AsEnumerable"-Method should be (like you can see here: http://msdn.microsoft.com/de-de/library ... 90%29.aspx)
So why does this piece of code not compile?
Thanks for the help!
I am working on a TxA- and -B- Series Target programming an application with database connection. So i thought about using a dataset and the "LINQ to Dataset" functionality. So I wrote the following code:
DataSet ds;
...
var result = ds.Tables["tabRecipe"].AsEnumerable()
.Where(row => row.IDRecipe == iIDRecipe && row.Priority >= iStepPriority)
.OrderBy(row => row.Priority)
.FirstOrDefault();
...
But when I'm trying to compile, the following error comes on:
"System.Data.DataTable" has no definition for "AsEnumerable", and there was no extension method "AsEnumerable...
The Microsoft .net documentation about LINQ in the .net cf says that LINQ to Dataset is also working on cf, and also the "AsEnumerable"-Method should be (like you can see here: http://msdn.microsoft.com/de-de/library ... 90%29.aspx)
So why does this piece of code not compile?
Thanks for the help!