G
Guest
I need to collect a "delta" between two Datasets: DS1 and DS2. DS2 was
created from DS1.
We cannot use/rely on RowState because of the operations involved in
generating DS2. Essentially all rows/columns are deleted and most are
re-added.
Can I use Merge between DS1/DS2 to generate a "Delta" Dataset? Something like:
DS1=DS2.Copy();
....
// Code that extensively modifies the DS2 Dataset
....
DS1.AcceptChanges(); // Reset RowState info - it is useless
DS2.AcceptChanges(); // Reset RowState info - it is useless
DS1.Merge(DS2, true);
sChanges = DS1.getChanges().GetXML();
I end up geting some XML - but it seems to bear little relation to the
changed area of the DataSet. Perhaps the RowState is killing me... is there a
way to get GetChanges() to work even if RowState is not valid?
It appears Merge() requires a Primary Key in order to detect row changes vs.
additions. Are there other limitations to using Merge?
Sorry for such a generic request. Worst case I will walk thru each table in
the Dataset determining changes/adds/etc... but I hate to do this if it's
already covered in the existing methods.
Thanks.
Jim
created from DS1.
We cannot use/rely on RowState because of the operations involved in
generating DS2. Essentially all rows/columns are deleted and most are
re-added.
Can I use Merge between DS1/DS2 to generate a "Delta" Dataset? Something like:
DS1=DS2.Copy();
....
// Code that extensively modifies the DS2 Dataset
....
DS1.AcceptChanges(); // Reset RowState info - it is useless
DS2.AcceptChanges(); // Reset RowState info - it is useless
DS1.Merge(DS2, true);
sChanges = DS1.getChanges().GetXML();
I end up geting some XML - but it seems to bear little relation to the
changed area of the DataSet. Perhaps the RowState is killing me... is there a
way to get GetChanges() to work even if RowState is not valid?
It appears Merge() requires a Primary Key in order to detect row changes vs.
additions. Are there other limitations to using Merge?
Sorry for such a generic request. Worst case I will walk thru each table in
the Dataset determining changes/adds/etc... but I hate to do this if it's
already covered in the existing methods.
Thanks.
Jim