DataTable.Merge()

M

mj2736

I'm a little confused about DataTable.Merge(). I have two DataTable
objects with the same structure - dtOrig and dtCurrent. The end result
I'm trying to achieve is to get all the rows in dtCurrent that are in
some way different from the corresponding rows in dtOrig so those new/
modified/deleted rows can be processed. My idea was to use
dtOrig.Merge(dtCurrent), and then call dtOrig.GetChanges(). But what I
found is that when the preserveChanges Merge() parameter is
'false' (or not supplied) the values in dtOrig do get updated, but the
RowState stays 'Unchanged'. When preserveChanges is 'true' then the
RowState for all rows becomes 'Modified' but the values in dtOrig are
NOT actually updated! What am I missing here? Is there a better way to
go about this? Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top