471,825 Members | 869 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,825 software developers and data experts.

Gaining Access to an Identity value

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
Nov 18 '05 #1
1 973
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.

--
Chris Jackson
Software Engineer
Microsoft MVP - Windows Client
Windows XP Associate Expert
--
More people read the newsgroups than read my email.
Reply to the newsgroup for a faster response.
(Control-G using Outlook Express)
--

"Jerry Camel" <rl*****@msn.com> wrote in message
news:OX**************@tk2msftngp13.phx.gbl...
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

Nov 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

42 posts views Thread by PC Datasheet | last post: by
42 posts views Thread by lauren quantrell | last post: by
16 posts views Thread by Ed A | last post: by
1 post views Thread by nicholas | last post: by
2 posts views Thread by =?Utf-8?B?RWRkaWU=?= | last post: by
NeoPa
reply views Thread by NeoPa | last post: by
aboka
reply views Thread by aboka | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.