Problem updating database after deleting someting!
I am working on basic sql using C # with bindings and adapters. I have successfully added the data to my database and can then update with no problem. But when I try to delete some data and then UPDATE it throws an exception:
An unhandled exception of type 'System.InvalidOperationException' occurred in System.Data.dll Additional information: The update requires a valid DeleteCommand when passing a DataRow collection with rows deleted.
The code:
private void button4_Click(object sender, EventArgs e)
{
table1TableAdapter.Update(dataSet1);
}
private void button5_Click(object sender, EventArgs e)
{
table1BindingSource.RemoveCurrent();
}
Why can't I update my database after deleting something from it?
0
Goul hetui
a source
to share