开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜