|
vb 2005
hi, im read somewhere that using strongly typed datasets, you should set the PK to autoincrement but in negative numbers so that it doesn't clash with the autonumbers generated by the database.
in my case, im using MySQL and strongly typed datasets. the UserID column in the database is set to autoincrement. on my typed dataset i have that column set to autoincrement but in negative numbers.
now, i have a form where i would like to present the user with a textbox bound to the UserID column. so i databind it to the UserID column.
my problem is, when i create a new row, the textbox shows a number like -1. worse is that when i persist to database, the value -1 gets stored instead of the normal autoincrement. i would like to know if there's a way to have the UserID dataset column not persist in the database even though its bound. i need it to be bound because i want to extract the value in the database and present that to the user, but i dont want to persist a negative number. how would i go about this?
|