Reputation: 1564
I've dynamically bind datagridview with my database table and ContactId column is autoincrement in my database table when i click on last row in gridview to insert data it shows me -1 then on next -2 when i save the contents and then again open it shows properly why such a behavior?
Upvotes: 2
Views: 996
Reputation: 273314
The negative values are temporary keys. Needed to make proper foreign key relations etc. And indeed replaced when the Db generates the real keys.
Upvotes: 1