Hi Keith,
>I don't know for certain, but the order of the merge seems suspect to me. dsChanges has all changes (including deletes)The order doesn't matter ... I've done it both ways with the same results.
And dsChanges does *not* include the Deletes (which is why I also do a .GetChanges(DataRowState.Deleted) to get the Deletes into the dsDeleted DataSet).
>Just a guess, really. It's after 5PM here and I turned off my brain about 30 minutes ago.LOL! You shouldn't be answering posts with no brain activity!! <g>
>I don't know why it would be different depending on when you set the primary key, except that perhaps upon setting the primary key all rowstate information is reset.Good theory, but I have already checked out RowState while debugging and as far as I can see RowState is correct prior to doing the Merge. In any event, I deleted the rows *after* setting the PrimaryKey, so that doesn't even come into play (turn your brain back on! <g>)
>To me, GetChanges, Merge, and RowState has always seemed to be a convoluted thing that never impressed me as able to stand the test of time. I figured that by now they would have come up with something a little more straightforward.Yeah, it *is* a bit awkward and that's why I've not utilized Merge at all. I probably do some of my database access in an unconventional matter. <g>
But, this particular experiment with Merge is because I'm trying to come up with a way to do some disconnected processing with minimal changes to my app. And, the Merge option isn't looking too promising at this point ... I think I'll be shifting gears, again, for about the 3rd time. <g>
But, thanks for your input. =)
~~Bonnie