0

I have a problem rejecting a DataSet with self-related tables.

First I insert a parent row and a child row in a table. Then I call RejectChanges method from the table object or the same method from the DataSet. The RejectChagnes method throws RowNotInTableException.

This is the code to demostrate this (TestRejectChanges.zip):

DataSet dataSet = new DataSet();

//Parent row
DataSet.TABLERow parentRowOverDataSet = dataSet.TABLE.AddTABLERow(1, "Parent", null);

//Child row
dataSet.TABLE.AddTABLERow(2, "Child", parentRowOverDataSet);

//This line crash because the child row is detached before Rolback (in RejectChanges method code)
dataSet.TABLE.RejectChanges();

//Also crash
//foreach (DataSet.TABLERow row in dataSet.TABLE.ToList())
//{
//    row.RejectChanges();
//}

//Also crash
//dataSet.RejectChanges();

I tryed to override RejectChanges of DataTable but this method is not virtual. Is there any way to do this using RejectChanges of DataSet?

1 Answers1

0

I opened a MS Solve Case (using MSDN Lisence) and, after a month of waiting for their response, they wrote me the next:

I did some research and had discussed with one of our team member in PG and this appears to be a by design issue as of now.

I went through your troubleshooting and suggestion:

Thanks a lot for you feedback on this issue. At this point of time, I am going to file a DCR (Design Change Request) to see if they can consider this functionality in up-coming release.

Then it has no solution by the moment.