dataset grief, addnew row issues

  • Thread starter Thread starter Guest
  • Start date Start date
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.
 
FY
In the SQL DB, ID field has attributes identity=yes, identity seed =1,identity increment =
In the Access DB, ID field is autonumber
 
Back
Top