Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

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

Posted on 2008-10-07
4
Medium Priority
?
589 Views
Last Modified: 2012-05-05
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?
0
Comment
Question by:freename
  • 2
  • 2
4 Comments
 
LVL 96

Expert Comment

by:Bob Learned
ID: 22663800
What happened with 'e.Rows.RejectChanges'?
0
 

Author Comment

by:freename
ID: 22664765
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
 
LVL 96

Accepted Solution

by:
Bob Learned earned 500 total points
ID: 22675032
If you left out the call to AcceptChanges, what happens after that step?  Are you writing the changes back to the database?
0
 

Author Closing Comment

by:freename
ID: 31504003
No longer need solution. Accepting this one since TheLearnedOne is the only one to answer.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In order to hide the "ugly" records selectors (triangles) in the rowheaders, here are some suggestions. Microsoft doesn't have a direct method/property to do it. You can only hide the rowheader column. First solution, the easy way The first sol…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question