I’m working with a dataset that’s connected to an sql server and what I’m trying to do is delete multiple rows at once and then saving the changes to the sql server. I’ve tried it with the code below:
DataRow[] rows = this.computechDataSet.VALHIS.Select("VAL_SRT = '" + this.computechDataSet.V_ALUTA.Rows[this.v_ALUTABindingSource.Position][0].ToString() + "'");
foreach (DataRow row in rows)
{
row.Delete();
}
this.computechDataSet.VALHIS.AcceptChanges();
this.tableAdapterManager.UpdateAll(this.computechDataSet);
The rows do get deleted from the dataset (Found out by outputting the datatable rowcounts) but the changes aren’t saved to my SQL database. I haven’t had any problems adding/editing/deleting rows on other tables, except in those cases I performed the actions for one row at a time.
try without
AcceptChanges