Hi all
I've written some code to test equality between column values in DataTables when the column type isn't known.
Testing directly like this:
row["Foo"] == row["Bar"]
always results in false, presumably because object's implementation of Equals uses ReferenceEquals.
So I've resorted to:
row["Foo"].ToString() == row["Bar"].ToString()
This works (at least for the cases I've encountered so far), but it seems a little, well, manky.
Can anyone think of a reason I shouldn't do it this way, or suggest a better way? Remember I don't know the column types at design time, so casting is not an option.
Thanks
David