We help IT Professionals succeed at work.

Understanding the Delete and Remove methods - datarow object

andrepires
andrepires asked
on
235 Views
Last Modified: 2012-06-21
Hello!
In a DataRow object we have the methods Delete and Remove.
The Delete method marks the row for deletion by changing the RowState property to Delete and hidding the row.
My question is about the Remove method.
It says that it completely revomes the row from the DataRowCollection, but what happens with that row when we save the changes in the dataset to the database?
In understand perfectly what happens when we use the Delete method, but the Remove method is not clear to me.
Also, if we use the Delete method, the row will be hidden and changed to Delete state. How can I undo this operation and bring the row back to its original state?

Thanks!
Comment
Watch Question

Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
Use RejectChanges to restore the row.
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.