Thanks, I saw this question previously and tried the suggestions but
neither worked.
When I try to manually iterate through each column and row, I verify
that two values are identical in the debugger but for some reason the
program always thinks they are different. My code for this is below.
The other suggestion (the one by Kevin Yu) also didn't work because I
can't guarantee that items within a row are identical. For example,
even if primary key "1" exists in both datasets, the data on that row
may have changed in one of the datasets. His solution only checks for
new and deleted rows, not updated row.
Any other suggestions?
Thanks,
Nate
*****
for (int i = 0; i < dsBase.Tables.Count; i++)
{
for (int j = 0; j < dsBase.Tables[i].Rows.Count; j++)
{
for (int k = 0; k < dsBase.Tables[i].Columns.Count; k++)
{
if (dsBase.Tables[i].Rows[j][k] != ds.Tables[i].Rows[j][k])
{
Assertion.Assert ("The database has changed!", false);
return;
}
}
}
}
|