When marshalling changes into a dataset and calling the update on this
dataset, you want to merge the result back into the orginal dataset.

This appears not to work when you modify any of the Primary Key columns
(please no lectures on modifying the primary key :-) ). By not working, I
mean I get duplicate rows. When I do not modify the PK, I do not get
duplicate rows.

The below are two sets of results from tracing through a modification of
tblPackageProduct. The first four columns make up the primary key. By
looking at the original and current values of the first set, you can see the
Original values are different so that should explain that.

However, on the 2nd second set of results there is no reason the changes
dataset and original dataset should not merge correctly (no duplicates).
The only explanation I can come up with is dataset merge will not work when
the PK is modified -- even if the values match up perfectly.

Can anyone explain this? I thought a solution might be to drop the PK before
marshalling the changes of the dataset and then reestablishing them after the
merge and accept changes. This way I could verify the PK is a factor or not.
I could not test test this since tblPackageProduct.PrimaryKey.Clear while
hopeful did not work for me.

Bill (see results below)

*************************************************
(again 1st four columns make up the PK)

tblPackageProduct (original dataset) (after modifications)
Original: 284 -- GRAD -- 10x14 -- 40 -- 1 -- 1 -- 0 -- False -- Modified
Current: 284 -- GRAD -- 4Wall -- 22 -- 4 -- 4 -- 0 -- False â?? Modified

tblPackageProduct (dsChanges) (before update is called on dsChanges)
Original: 284 -- GRAD -- 10x14 -- 40 -- 1 -- 1 -- 0 -- False -- Modified
Current: 284 -- GRAD -- 4Wall -- 22 -- 4 -- 4 -- 0 -- False â?? Modified

tblPackageProduct (original dataset) (after update is called on dsChanges
and merge)
Original: 284 -- GRAD -- 10x14 -- 40 -- 1 -- 1 -- 0 -- False -- Modified
Current: 284 -- GRAD -- 4Wall -- 22 -- 4 -- 4 -- 0 -- False -- Modified
Original: 284 -- GRAD -- 4Wall -- 22 -- 4 -- 4 -- 0 -- False -- Unchanged
Current: 284 -- GRAD -- 4Wall -- 22 -- 4 -- 4 -- 0 -- False â?? Unchanged

tblPackageProduct (original dataset) (after accept changes)
Original: 284 -- GRAD -- 4Wall -- 22 -- 4 -- 4 -- 0 -- False -- Unchanged
Current: 284 -- GRAD -- 4Wall -- 22 -- 4 -- 4 -- 0 -- False -- Unchanged
Original: 284 -- GRAD -- 4Wall -- 22 -- 4 -- 4 -- 0 -- False -- Unchanged
Current: 284 -- GRAD -- 4Wall -- 22 -- 4 -- 4 -- 0 -- False â?? Unchanged

***************************************************

This time I set the datadapter to skip Update Status of the current row by
setting e.Status = UpdateStatus.SkipCurrentRow in the
SqlRowUpdatedEventHandler.

tblPackageProduct (original dataset) (after modifications)
Original: 284 -- GRAD -- 4Wall -- 22 -- 4 -- 4 -- 0 -- False -- Modified
Current: 284 -- GRAD -- 4x6 -- 30 -- 4 -- 1 -- 0 -- False -- Modified

tblPackageProduct (dsChanges) (before update is called on dsChanges)
Original: 284 -- GRAD -- 4Wall -- 22 -- 4 -- 4 -- 0 -- False -- Modified
Current: 284 -- GRAD -- 4x6 -- 30 -- 4 -- 1 -- 0 -- False -- Modified

tblPackageProduct (original dataset) (after update is called on dsChanges
and merge)
Original: 284 -- GRAD -- 4Wall -- 22 -- 4 -- 4 -- 0 -- False -- Modified
Current: 284 -- GRAD -- 4x6 -- 30 -- 4 -- 1 -- 0 -- False -- Modified
Original: 284 -- GRAD -- 4Wall -- 22 -- 4 -- 4 -- 0 -- False -- Modified
Current: 284 -- GRAD -- 4x6 -- 30 -- 4 -- 1 -- 0 -- False â?? Modified

tblPackageProduct (original dataset) (after update is called on dsChanges
and merge)
Original: 284 -- GRAD -- 4x6 -- 30 -- 4 -- 1 -- 0 -- False -- Unchanged
Current: 284 -- GRAD -- 4x6 -- 30 -- 4 -- 1 -- 0 -- False -- Unchanged
Original: 284 -- GRAD -- 4x6 -- 30 -- 4 -- 1 -- 0 -- False -- Unchanged
Current: 284 -- GRAD -- 4x6 -- 30 -- 4 -- 1 -- 0 -- False -- Unchanged