Solved

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

Posted on 2008-10-07
4
579 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
Comment Utility
What happened with 'e.Rows.RejectChanges'?
0
 

Author Comment

by:freename
Comment Utility
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 250 total points
Comment Utility
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
Comment Utility
No longer need solution. Accepting this one since TheLearnedOne is the only one to answer.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Article by: Najam
Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

763 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now