开发者

tableadapter VB.net 2008 - retrieve identity

开发者 https://www.devze.com 2022-12-10 10:24 出处:网络
I am inserting a record to a MSSQL table using a tabl开发者_如何学运维eadapter using something like:

I am inserting a record to a MSSQL table using a tabl开发者_如何学运维eadapter using something like: Dim da_mytable As New t_mytableTableAdapter da_mytable.Insert(xxxx,xxxx,xxxx)

The SQL table has an identity field which is also the PK for the table.

The insert works fine, but my question is how to return the ID that was used on the insert.

Thank you.


Solution described here.

http://blogs.msdn.com/smartclientdata/archive/2005/10/31/ReturnIdentityValueQuery.aspx

0

精彩评论

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