I have an problem with updating a database after I have deleted or edited a database row in VB.NET. When I insert a new row it works well.
When I delete I get the following error message:
Update requires a valid DeleteCommand when passed DataRow collection with deleted rows
And when I edit I get the following message:
Update requires a valid UpdateCommand when passed DataRow collection with modified rows
Does someone know the code I need?
Here is the code I use and that does not work:
[INDENT]Me.KlantBindingSource.RemoveCurrent() Me.Validate() Me.KlantBindingSource.EndEdit() KlantTableAdapter.Update(Me.DataDataSet)[/INDENT]
[INDENT]Me.Validate() Me.KlantBindingSource.EndEdit() KlantTableAdapter.Update(Me.DataDataSet)[/INDENT]
The name of mine bindingsource is KlantBindingSource, the name of mine TableAdapter is KlantTableAdapter and the name of mine DataSet is DataDataSet.
I am using Microsoft Visual Studio 2008