J
jbaldi
I have two seperate .net programs that are working with the same table
in a SQL database. Both programs are using TableAdapters to read/
write to the table. Both programs can create a record in their
TableAdapters using the same primary key. If this happens and one
program updates the database before the other, the later will generate
the following SqlException: "Violation of PRIMARY KEY constraint
'PK_TableName'. Cannot insert duplicate key in object 'TableName'.
How do I force the latter program's TableAdapter to do an UPDATE
rather than and INSERT?
in a SQL database. Both programs are using TableAdapters to read/
write to the table. Both programs can create a record in their
TableAdapters using the same primary key. If this happens and one
program updates the database before the other, the later will generate
the following SqlException: "Violation of PRIMARY KEY constraint
'PK_TableName'. Cannot insert duplicate key in object 'TableName'.
How do I force the latter program's TableAdapter to do an UPDATE
rather than and INSERT?