Question:
I addeda new recordbybindingsource.addnew(), and then saved it to database.The bindingsource show the primary key is -1. How can Iget the primary key from the database to bindingsourcecontrol?
I knowTableAdapter.fill() can get the whole table, include the primary key, but is there any quickly way?
Problem:
When I runbindingsource1.addnew() to add a new record, the primary key of the new record is -1.Afterthe record was saved to database, the primary key is -1 also.
If I do some other changes and save the changes again, the bindingsource tells me the constraint conflicted. It caused by the added record's primary key, the record's primary key is -1 and it cann't beupdate to database.