SqlAdaptor.update a dataset for a SQLserver DB table that uses a autoincrementing primary key column
I have a SQL server table that has a primary key column that is auto incrementing when new record is added.
I am loading a DataSet with SqlAdapter. select SQL statement, created with query editor and auto generate update and insert using the wizard.
I need advice. When I have loaded DataSet with select statement reflecting existing table data, what do i do when i add a new row of data to the DataSet. The DataSet wont know about the auto-incrementing primary key of the table, so can I just call the auto generated update command and the DataSet sorts itself out and gets the correct primary key from the table or what?
How is one supposed to deal 开发者_运维问答with this situation
Retrieving Identity or Autonumber Values (ADO.NET)
Check Merging New Identity Values section.
精彩评论