dataset grief, addnew row issues

G

Guest

I have a dataset which contains a employee table (similar to that in the nwind db)
I use the NewRow method of the table to get a datarow object then fill this with my new data
At this point the 'EmployeeID field of the datarow is 0
I then add this new row to tables row collection
I then call the update method of the data adaptor
The new row is inserted into the DB but the EmployeeID field is still 0
How do i get the ID field of the added datarow to be filled in 'automatically'
(For every new row that i add to the DS the EmployeeID is 0 - this is no good)

Do i have to write code to requery the added row and get the ID et
(I'm using SQL and Access DBs in a multi-user environment)

Thanks for help in advance.
 
G

Guest

FY
In the SQL DB, ID field has attributes identity=yes, identity seed =1,identity increment =
In the Access DB, ID field is autonumber
 

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