954,517 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

TableAdapter Update Method

Hi guys, I have got a button to update and save data changes.

When I did not make any changes, I will have a successful update.

When I made changes, it will be give me this error:(Without Try statements)

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

The below is my codings. Anyone have suggestions? Thanks.:eek:

If Me.Validate Then
Try
Me.CanDrinksBindingSource.EndEdit()
Me.CanDrinksTableAdapter.Update(Me.StockDataSet.CanDrinks) 'Update method
MessageBox.Show("Update Successful!")

Catch ex As Exception
MessageBox.Show("Update failed")
End Try
End If

LiBOC
Junior Poster in Training
73 posts since Jul 2005
Reputation Points: 10
Solved Threads: 1
 

What did you set the UpdateCommand property as?

Inanna
Junior Poster in Training
90 posts since Oct 2006
Reputation Points: 53
Solved Threads: 6
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You