Hi. I have (I suppose) a typical problem. I have a details form and I want to add a new record by clicking the add button on a bindingnavigator. I've read a lot of forums with the same problem but i don see any clear solution. The problem is that the primary key of the table is autoincrement so i don't know its value and i don't want to get the next id because if other user makes the same action (add row) one of them will get an error (right?). The problem i'm getting is that before I make an update to the underlying dataset i suppose that is necessary to call endEdit method of the bindingsource, but i get an error because of the null value of the primary key. I tried to add a dummy value (for example 0) to the primary key and that works fine because the db engine assigns an autoincremented value. The problem is that there are other nested bindingsources bounded to a relation of the underlying dataset and one of it's primarykey fields is the new autoincrement field.
Any ideas?
Thank you
Any ideas?
Thank you