Hi,
do the dotConnect any LinQ products from devart support these functions?
I always get a LinQ to SQL does not know function that exception.
Regards
LinQ: Take TakeWhile
TakeWhile is a Linq to Objects method, and is not supported in LinqConnect (or LINQ to SQL), as it cannot be converted into any valid SQL.
However, you can get a wider result set into the memory and use TakeWhile on it.
You could try using:
By adding the AsEnumerable(), the entire table is brought into memory. The TakeWhile can then be done in memory and not as part of the SQL Statement.
J.C.: The method "Take" is supported by Devart products. If you encounter any problems with it, could you please describe the situation in which they occur?
However, you can get a wider result set into the memory and use TakeWhile on it.
You could try using:
Code: Select all
YourDataContext dc = new YourDataContext();
var q = (from c in dc.Customers.AsEnumerable()
select c).TakeWhile(c => c.City != string.Empty);
J.C.: The method "Take" is supported by Devart products. If you encounter any problems with it, could you please describe the situation in which they occur?