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?
freenameAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
Bob LearnedConnect With a Mentor Commented:
If you left out the call to AcceptChanges, what happens after that step?  Are you writing the changes back to the database?
0
 
Bob LearnedCommented:
What happened with 'e.Rows.RejectChanges'?
0
 
freenameAuthor Commented:
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().
0
 
freenameAuthor Commented:
No longer need solution. Accepting this one since TheLearnedOne is the only one to answer.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.