I have this situation with ADO that is giving me a problem.
I have two related tables -
Products
ProductVendors (id, VendorID, ProductID)
There is a One.Product to many Vendors relation and ProductVendors. VendorID + ProductVendors. ProductID must be unique.
They are on one Form that consists of one Product and a DataGridView that allows for the inputing of multiple vendors.
Here is the problem. If the user opens a record that consist of:
Product: Printer Toner 123
Vendors: ABC Inc
Zen Inc
xxx Inc
then user adds ABE INC again, then noticing the duplicate entry, and removes ABC INC in the first record, then when updating - using the
tablemanagerada pter.updateall - it returns an error of a violoation of the Unique Key in ProdcutVendors.
I think what is happening is that the TableAdapterMan ager is first doing Updates or Inserts and as such it creates a violation.
I don't see an option to tell the TableAdapterMan ager to first process the Deletes.
Any suggestion how to handle this?
I have two related tables -
Products
ProductVendors (id, VendorID, ProductID)
There is a One.Product to many Vendors relation and ProductVendors. VendorID + ProductVendors. ProductID must be unique.
They are on one Form that consists of one Product and a DataGridView that allows for the inputing of multiple vendors.
Here is the problem. If the user opens a record that consist of:
Product: Printer Toner 123
Vendors: ABC Inc
Zen Inc
xxx Inc
then user adds ABE INC again, then noticing the duplicate entry, and removes ABC INC in the first record, then when updating - using the
tablemanagerada pter.updateall - it returns an error of a violoation of the Unique Key in ProdcutVendors.
I think what is happening is that the TableAdapterMan ager is first doing Updates or Inserts and as such it creates a violation.
I don't see an option to tell the TableAdapterMan ager to first process the Deletes.
Any suggestion how to handle this?