Stepping thru the code with the debugger shows the dataset rows being deleted.
After executing the code, and getting to the page presentation. Then I stop the debug and start the
page creation process again ( Page_Load ). The database still has the original deleted dataset rows.
Adding rows works, then updating works fine, but deleting rows, does not seem to work.
The dataset is configured to send the DataSet updates to the database. Use the standard wizard to create the dataSet.
cDependChildTA.Fill(cDependChildDs._ClientDependentChild, UserId);
rowCountDb = cDependChildDs._ClientDependentChild.Count;
for (row = 0; row < rowCountDb; row++)
{
dr_dependentChild = cDependChildDs._ClientDependentChild.Rows[0];
dr_dependentChild.Delete();
//cDependChildDs._ClientDependentChild.Rows.RemoveAt(0);
//cDependChildDs._ClientDependentChild.Rows.Remove(0);
/* update the Client Process Table Adapter*/
// cDependChildTA.Update(cDependChildDs._ClientDependentChild);
// cDependChildTA.Update(cDependChildDs._ClientDependentChild);
}
/* zero rows in the DataSet at this point */
/* update the Child Table Adapter */
cDependChildTA.Update(cDependChildDs._ClientDependentChild);
Hi,
You should use AcceptChanges method after using delete in order to update the data. The following link may be helpful to you.
http://msdn2.microsoft.com/en-us/library/ms233823(VS.80).aspx
Thanks.