HighTechTalks DotNet Forums  

using a DataAdapter to insert with identity column

Dotnet Framework (ADO.net) microsoft.public.dotnet.framework.adonet


Discuss using a DataAdapter to insert with identity column in the Dotnet Framework (ADO.net) forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Andy Fish
 
Posts: n/a

Default using a DataAdapter to insert with identity column - 11-21-2007 , 11:31 AM






hi,

i am using a DataAdapter and DataSet to insert rows into a table which has
an identity column

I would expect that once I have executed the update, the field in the
corresponding DataRow would have been updated to reflect the newly allocated
id, but this does not seem to be the case.

am I missing something simple or does it simply not do this?

Andy



Reply With Quote
  #2  
Old   
W.G. Ryan
 
Posts: n/a

Default Re: using a DataAdapter to insert with identity column - 11-21-2007 , 12:36 PM






Andy:

If you're asking "Does the DataTable get automatically updated with Identity
values from the server once the insert happens"? then the answer is no. You
can search google for Bill Vaughn's Managing an @@Identity Crisis. You
basically need an output paramater or an additional query to get the
identities. If you're using the wizard, on one of the last steps, I think
youchoose Advanced and there's an option to Refresh Identify values (you
have to forgive me, I'm not a big wizard guy and my memory is a little
foggy)
"Andy Fish" <ajfish (AT) blueyonder (DOT) co.uk> wrote

Quote:
hi,

i am using a DataAdapter and DataSet to insert rows into a table which has
an identity column

I would expect that once I have executed the update, the field in the
corresponding DataRow would have been updated to reflect the newly
allocated id, but this does not seem to be the case.

am I missing something simple or does it simply not do this?

Andy





Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.