chazparks2

Usually, I can run code like this:

Code Snippet

Me.Validate()

Me.bsPostElementAttempt.EndEdit()

Me.taElementAttempt.Update(Me.DsQI02414Dev.tblElementAttemptCPO)

and it will update a table.

But for some reason this time I am getting:

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

instead of a successful update.

What should I be looking for



Re: Visual Basic General Updating a table

DigBoy2000

I'm not well versed on tableadapters but you should start by looking at the update command it is trying to use. Was the table adapter generated by the datagridview wizard If so then it might have only generated a SELECT command and not any others. If you right-click on the tableadapter in the designer select "Add Query" from the context menu to open the wizard that can guide you to creating the update command.





Re: Visual Basic General Updating a table

Omar Abid

First : Are you using a typed Data Base

If so Digboy is right

Goto the dataset designer and make the select command