Gaining Access to an Identity value

J

Jerry Camel

When I add a new row to a table that has an Identity column, how can I
access the value of the identity column for the row that I just added. Do I
have to re-fill the dataset through the adapter? If I do that, how can I
tell which is the row I just added?

Thanks

Jerry
 
C

Chris Jackson

You do have to use the data adapter, because the value of the identity
column has no meaning until you have updated the server. You can subscribe
to the data adapter's RowUpdated event, and then SELECT @@IDENTITY.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top