Gaining Access to an Identity value

  • Thread starter Thread starter Jerry Camel
  • Start date Start date
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
 
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.
 
Back
Top