Andreas,
Have the changes occured on the back end database, or have the changes
occured in the dataset (you manually added rows, etc, etc). If the case is
the latter, then you can call the GetChanges method on the DataSet and it
will give you a new DataSet with only the changes since the last time
AcceptChanges has been called on the dataset.
If the case is the former, then you will have to query the back end.
You have a list of unique ids that were in the table, so if you select out
the records from the table where the id is not in that set, those are the
adds. Then, you have to perform a select where the ids in that set are not
in the table. These are the deletes. Finally, you will have to do a
comparison (either field by field, or by a timestamp of some sort) for the
rows that still exist in the table (these are edits).
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
-
ni**************@exisconsulting.com
"Andreas Huber" <ah****@gmx.net> wrote in message
news:3e**************************@posting.google.c om...
Hi there
I have two typed DataSets. One represents the state of a certain DB
table some time ago, the other represents the current state of the
same DB table. Now I would like to get the changes in a third table,
each row with the appropriate row state Added, Deleted or Modified. Is
there any way to do that with .NET (except for hand-crafting the
comparison myself)?
I have tried to get the changes with setting
SqlDataAdapter.AcceptChangesDuringFill to false and then filling the
old data set. But this sets *all* rows to Modified, even if there was
no change at all!
I need this functionality because I only want to send the data that
has actually changed to the clients (transmitting the full DataSet is
not an option because it can very well be 60MB+ in size and network
bandwith is precious).
Any help is greatly appreciated.
Thanks,
Andreas