I’ve scenario where the datatable may contain large number of rows. As a result i am not able to iterate and update the datatable using a loop.
I’ve tried the following code,
from row in table.AsEnumerable()
where table.Columns.Any(col => !row.IsNull(col))
select row;
But i can’t find definition for Any(). Is there any namespace i should use to get Any()?
Any body please tell me how to correct this or suggest any alternate solutions..
Apart from having to use the
System.Linqnamespace you also need to make it aware of the element types.DataTable.Columnsis not a generic collection (it implements onlyIEnumerablenotIEnumerable<T>) and the compiler cannot infer the type. You need to do something like this: