Update requires a valid UpdateCommand when passed DataRow collection with modified rows.

First lets start with, I downloaded the 2005 Visual Studio beta 2 ver. and I am programming in Visual Basic.
This is my first project with this language and I let the wizards do all the work. To my suprise the automatic wizard code fail to write the correct code.
Steps
I made a connection to a access database. I installed a dataview grid and then tried to correct data. I got the following error when I tried to (save data). Update requires a valid UpdateCommand when passed DataRow collection with modified rows.
Look at the

PublicOverloadsOverridableFunction Update(ByVal dataTableAs SubContractorsDataSet.SubContractorsDataTable)AsInteger

ReturnMe.Adapter.Update(dataTable)

EndFunction


I read some other articles about this error and they stated to use a database with a primary key, so I changed the 'company' field of my database to use a primary key. but i get the same results.
Does any body know what I can do to correct this.

[1704 byte] By [MSwift] at [2007-12-17]
# 1

Try this, it worked to me:

Go to edit dataset with designer (you can go there from the "Data" menu then "show data sources" and "Edit dataset with designer".

Right click the adapter and select "Configure". Click "Advanced options". Make sure the "Refresh the data table" is selected. Click OK and Finish.

Tell me if it works. Good luck.

OsamaAlborbar at 2007-9-8 > top of Msdn Tech,Visual Basic,Visual Basic General...
# 2
Make sure the table has a primary key
JimHomminga at 2007-9-8 > top of Msdn Tech,Visual Basic,Visual Basic General...