P
PoloOpenAir
vb.net application:
I'm having trouble with an identity-column changing to a new value, if
an error is raised on insert - ex. violation of unique constraint on
another db-column. An new value is assigned to the ID-column in the
database, but not in the form, when I correct the values violating the
unique constraint. The ID-field in the form doesn't get updated.
An example:
Table:
ID:
BIGINT, Identity:YES, Identity Seed:1, Identity Increment:1
ORDERNO:
BIGINT, Unique constraint
Scenario:
Calling AddNew-method on bindingmanager. The value 500 is assigned to
the ID-field in the form. Enter an Orderno. which will violate the
unique constraint. Trying to insert the record. An unique-constraint
exception is thrown. I corret the Orderno. so it doesn't violate the
constraint anymore. Trying to insert. Insert succeded. The value of
the ID-field is still 500, but in the database the value has changed
to 501.
I have generated the DataAdapter with the wizard - and the
refresh-option is enabled. But the value doesn't get updated.
Has anyone experinced the same?
I'm having trouble with an identity-column changing to a new value, if
an error is raised on insert - ex. violation of unique constraint on
another db-column. An new value is assigned to the ID-column in the
database, but not in the form, when I correct the values violating the
unique constraint. The ID-field in the form doesn't get updated.
An example:
Table:
ID:
BIGINT, Identity:YES, Identity Seed:1, Identity Increment:1
ORDERNO:
BIGINT, Unique constraint
Scenario:
Calling AddNew-method on bindingmanager. The value 500 is assigned to
the ID-field in the form. Enter an Orderno. which will violate the
unique constraint. Trying to insert the record. An unique-constraint
exception is thrown. I corret the Orderno. so it doesn't violate the
constraint anymore. Trying to insert. Insert succeded. The value of
the ID-field is still 500, but in the database the value has changed
to 501.
I have generated the DataAdapter with the wizard - and the
refresh-option is enabled. But the value doesn't get updated.
Has anyone experinced the same?