M
michael
I have a SQLDataAdapter that contols data between a SQL
table whose Primary Key is an "Identity" column and a
DataSet in my application.
I also have a DataGrid that displays the DataSet's copy
of the SQL table. I noticed that if I click on a "new
row", the Identity column is incremented automatically.
Now, lets say that I don't actually enter anything in the
new row and click on an "old" row, and then click on the
new row again. Well, the Identity column auto-increments
again, even though the Identity column number is one
higher than it should be (I never entered data the first
time). If I now execute an .Update, the row is added to
the SQL database, but the value of the Identity column in
the SQL database is correctly incremented while the value
of the Identity column in the dataset is NOT the same
value as the Identity column of the row just entered in
the SQL database (and this causes all kinds of problems!).
What then is the purpose of the Refresh the DataSet
option in the DataAdapter? It doesn't seem to update the
Identity column of the DataSet at all?
Michael
table whose Primary Key is an "Identity" column and a
DataSet in my application.
I also have a DataGrid that displays the DataSet's copy
of the SQL table. I noticed that if I click on a "new
row", the Identity column is incremented automatically.
Now, lets say that I don't actually enter anything in the
new row and click on an "old" row, and then click on the
new row again. Well, the Identity column auto-increments
again, even though the Identity column number is one
higher than it should be (I never entered data the first
time). If I now execute an .Update, the row is added to
the SQL database, but the value of the Identity column in
the SQL database is correctly incremented while the value
of the Identity column in the dataset is NOT the same
value as the Identity column of the row just entered in
the SQL database (and this causes all kinds of problems!).
What then is the purpose of the Refresh the DataSet
option in the DataAdapter? It doesn't seem to update the
Identity column of the DataSet at all?
Michael