I'm working on basic sql, using C# with binding options and adapters. I have sucessfully added data to my database and can then update with no problems. 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: Update requires a valid DeleteCommand when passed DataRow collection with deleted rows.
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 removing something from it?