Closed GoogleCodeExporter closed 8 years ago
My apologies. The above code will not reproduce the error, but this will:
XElement element = new XElement("Values", from c in
excel.WorksheetNoHeader("Sheet1") where (testWhere(c[0]) == true) select new
XElement("Value"));
Original comment by rotsiser...@gmail.com
on 13 May 2011 at 10:14
You can't use a cell value as an argument for a method in the where clause.
It's not possible to create the sql statement from it.
Here's a simple fix to your problem though. First download all the rows by
casting it to a list and then apply your where clause to the in-memory list.
Here is how it would look in your code example:
XElement element = new XElement("Values", from c in
excel.WorksheetNoHeader("Sheet1").ToList() where (testWhere(c[0]) == true)
select new XElement("Value"));
Notice I added the 'ToList()' method.
Let me know if that doesn't resolve your issue.
Original comment by paulyo...@gmail.com
on 23 May 2011 at 3:30
Original issue reported on code.google.com by
rotsiser...@gmail.com
on 13 May 2011 at 10:10