?
Solved

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

Posted on 2008-10-07
4
Medium Priority
?
586 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses

752 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