469,356 Members | 2,010 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,356 developers. It's quick & easy.

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 947
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
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.