using a DataAdapter to insert with identity column

A

Andy Fish

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
 
W

W.G. Ryan

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)
 

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

Top