RejectChanges();
Posted: Fri 13 Jan 2006 21:29
I want insert in the table of the database some records, for example 10, which I have in the DataSet myDataSet, DataTable "MyTable"
myAdapter.Update(myDataSet, "myTable");
myDataSet.Tables["myTable"].AcceptChanges();
}
catch (Exception e)
{
myDataSet.Tables["myTable"].RejectChanges();
}
If I have exception situation in record 5, the first four records appeared in the database, but another 6 not. How can I do that if I try update DataSet, and catch exception, nothing appeared in the database? Why RejectChanges doesn't work?
myAdapter.Update(myDataSet, "myTable");
myDataSet.Tables["myTable"].AcceptChanges();
}
catch (Exception e)
{
myDataSet.Tables["myTable"].RejectChanges();
}
If I have exception situation in record 5, the first four records appeared in the database, but another 6 not. How can I do that if I try update DataSet, and catch exception, nothing appeared in the database? Why RejectChanges doesn't work?