B
Bob Bartel
I have a routine to compare the current value with the original value of
fields in a Datatable. The code loops through each column to compare the
values and builds an update statement for those columns that have changed.
But for some reason, the Datetime fields are evaluating as not equal when
they are! (I just retreived the row and did nothing with the Datetime
columns, and in the debugger "a" and "b" look the same).
Here is the code:
DataRow Row = MyTable.Rows[0];
foreach (DataColumn column in Columns)
{
a = Row[column.ColumnName, DataRowVersion.Current];
b = Row[column.ColumnName, DataRowVersion.Original];
if (b != a)
{
//Build Update Statement
}
}
Any thoughts anyone?
Thanks in advance.
Bob Bartel
fields in a Datatable. The code loops through each column to compare the
values and builds an update statement for those columns that have changed.
But for some reason, the Datetime fields are evaluating as not equal when
they are! (I just retreived the row and did nothing with the Datetime
columns, and in the debugger "a" and "b" look the same).
Here is the code:
DataRow Row = MyTable.Rows[0];
foreach (DataColumn column in Columns)
{
a = Row[column.ColumnName, DataRowVersion.Current];
b = Row[column.ColumnName, DataRowVersion.Original];
if (b != a)
{
//Build Update Statement
}
}
Any thoughts anyone?
Thanks in advance.
Bob Bartel