B
Brian Korenaga
I'm trying to update a dataset using the GetChanges method, then using
the Merge method to integrate the updated data from the server. The
problem I am having is that when editing row(s) (add/delete is fine),
I am throwing an exception related to the GUID primary key. My
guideline is David Sceppa's ADO .Net book, Chapt. 11.
Per Sceppa's book and the Microsoft docs, the Merge method is supposed
to compare primary keys - if they are identical, the method is
supposed to combine the contents into a single row.
However, when my code gets to the merge statement, I get the following
error:
Additional information: Dataset constraint errors found:
IndividualFromHousehold:Column 'IndividualId' is constrained to be
unique. Value '73875f68-fd9c-4a15-98b9-ed6492c385c4' is already
present.
IndividualFromHousehold:Column 'IndividualId' is constrained to be
unique. Value '73875f68-fd9c-4a15-98b9-ed6492c385c4' is already
present.
When I manually remove the edited row(s) from the original dataset
based on DataViewRowState.ModifiedCurrent, the merge comes off without
a hitch.
Given that PK are SUPPOSED to be unique, does anybody have any ideas
why this isn't working?
Thanks,
Brian
the Merge method to integrate the updated data from the server. The
problem I am having is that when editing row(s) (add/delete is fine),
I am throwing an exception related to the GUID primary key. My
guideline is David Sceppa's ADO .Net book, Chapt. 11.
Per Sceppa's book and the Microsoft docs, the Merge method is supposed
to compare primary keys - if they are identical, the method is
supposed to combine the contents into a single row.
However, when my code gets to the merge statement, I get the following
error:
Additional information: Dataset constraint errors found:
IndividualFromHousehold:Column 'IndividualId' is constrained to be
unique. Value '73875f68-fd9c-4a15-98b9-ed6492c385c4' is already
present.
IndividualFromHousehold:Column 'IndividualId' is constrained to be
unique. Value '73875f68-fd9c-4a15-98b9-ed6492c385c4' is already
present.
When I manually remove the edited row(s) from the original dataset
based on DataViewRowState.ModifiedCurrent, the merge comes off without
a hitch.
Given that PK are SUPPOSED to be unique, does anybody have any ideas
why this isn't working?
Thanks,
Brian