Nuno Magalhaes wrote:
I have a DataTable in which the items are of type MyClass.
How can I use Select to compare a MyClass instance with the DataTable?
Is there any overriden method (like the ToString()) to use it on
Select?
The DataTable .Select() can only be used to select items based on column
values. You can use the "Convert" operator to cast columns, but you cannot
operate on entire rows. You'll have to do it manually by enumerating the rows.
If you have .NET 3.5 you can just .Cast() the elements and use the LINQ
..Select() rather than the DataTable .Select(), which is more powerful and
gives you compile-time checking.
--
J.