Link to home
Start Free TrialLog in
Avatar of freename
freenameFlag for United States of America

asked on

How do I AcceptChanges to DataSet when there are Rows with RowState of Detached?

Using .Net 1.1
I have a DataSet and have subscribed to the RowChanged event. When this row fires, I reject some rows under certain conditions. The rows are rejected using the e.Rows.RejectChanges() method. I have also tried e.Row.Delete() method. Problem is, it leaves these rows in the Row Collection with a RowState of detached. When I attempt to use the AcceptChanges() method, the RowNotInTableException is thrown. Any suggestions what I can do?
Avatar of Bob Learned
Bob Learned
Flag of United States of America image

What happened with 'e.Rows.RejectChanges'?
Avatar of freename

ASKER

The LearnedONe,
It appears to reject the changes. However, when I look at the RowsCollection, it is still there. Its RowState is detached. Thus the problem when I do AcceptChanges().
ASKER CERTIFIED SOLUTION
Avatar of Bob Learned
Bob Learned
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
No longer need solution. Accepting this one since TheLearnedOne is the only one to answer.