I am working on a VB .Net 2005 application with a MS Access database backend. I am able to add a new row to a datatable via a DataGridView control. After invoking the Update method on the TableAdapter, I have verified the new row is written to the Access database with the values I've entered. This problem is I get a concurrency violation error when attempting to save (update) a subsequent edit of the newly added row. I am the only person making edits to this database. This row does contain an autonumber field. Making the TableAdapter.Fill call again to refresh the datatable after initially adding the row corrects the problem, but seems inefficient and causes the selected item in the grid control to be reset. I suspect I need to refresh my datatable to get the new primary key value, just wondering if someone could help provide some guidance on a preferred method to correct this issue. Thanks!

Concurrency Violation When Updating MS Access Db
Christian Reizlein
Hi,
Sorry for the delay. Your problem is that you probably don't fetch new Category_Id (autoinc field, right ).
So, you migth read
Retrieving Identity or Autonumber Values
in .net help files.
David Lam
Kris_Jana
Amit Chattopadhyay
Thanks for the response. My tableadapter definition was created by the dataset designer. I looked at the insert and update string for the tableadapter, looks ok to me - but I'm a newbie. Here they are:
INSERT INTO Category
(Category_Name, Category_Order, Program_ID, Category_Option)
VALUES ( , , , )
UPDATE Category
SET Category_Name = , Category_Order = , Program_ID = , Category_Option =
WHERE (Category_ID = ) AND ( = 1 AND Category_Name IS NULL OR
Category_Name = ) AND ( = 1 AND Category_Order IS NULL OR
Category_Order = ) AND ( = 1 AND Program_ID IS NULL OR
Program_ID = ) AND ( = 1 AND Category_Option IS NULL OR
Category_Option = )
Although my database is updated with the new autonumber key for this row, the datagridview still displays "-1" for the key value of the new row. The subsequent update of other non-key attributes in the new row containing the "-1" key value result in the concurrency error. Any ideas