473,406 Members | 2,378 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Undo DataRow.Delete?

I would like to set the RowState from Deleted to Unchanged on specific rows,
without calling RejectChanges. I have a feeling that if I enumerate the
collection, the Deleted rows will not be in the collection. Will FindRow
exhibit the same behavior? What would be a good way to approach this?

Thoughts?

Thanks,

Craig Buchanan
Jul 24 '08 #1
3 1958
Not sure you can take that particular approach, but my initial thought was
to perhaps consider using a cloned dataset so you can "restore" from it.
May depend on the size of your dataset and app memory requirments, etc, as
to whether that's reasonable to do or not.
"Craig Buchanan" <so*****@microsoft.comwrote in message
news:O0**************@TK2MSFTNGP02.phx.gbl...
>I would like to set the RowState from Deleted to Unchanged on specific
rows, without calling RejectChanges. I have a feeling that if I enumerate
the collection, the Deleted rows will not be in the collection. Will
FindRow exhibit the same behavior? What would be a good way to approach
this?

Thoughts?

Thanks,

Craig Buchanan

Jul 25 '08 #2
Craig Buchanan wrote:
I would like to set the RowState from Deleted to Unchanged on
specific rows, without calling RejectChanges. I have a feeling that
if I enumerate the collection, the Deleted rows will not be in the
collection. Will FindRow exhibit the same behavior? What would be a
good way to approach this?
Do you mean not calling RejectChanges on the whole table?
You can RejectChanges on individual rows, you don't have to do them all.

For any row, a datatable is basically hanging on to two versions: the original
and the currrent. It does not, for instance, save edits to the row made before
it was deleted. If you have deleted a row, then you can either leave it like
that, or get back the original using RejectChanges on that row.
Jul 25 '08 #3
I was able to use the DataRow.Item(columnName, DataRowVersion.Original) for
my purposes.

"Craig Buchanan" <so*****@microsoft.comwrote in message
news:O0**************@TK2MSFTNGP02.phx.gbl...
>I would like to set the RowState from Deleted to Unchanged on specific
rows, without calling RejectChanges. I have a feeling that if I enumerate
the collection, the Deleted rows will not be in the collection. Will
FindRow exhibit the same behavior? What would be a good way to approach
this?

Thoughts?

Thanks,

Craig Buchanan

Aug 27 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Jay | last post by:
I need to implement an undo and redo for an entire row in a listview containing approximately 10 columns. I'm not sure of the best way to implement this. The only thing that I've thought of is a...
2
by: s-galit | last post by:
im trying to use the undo function of the richTextBox but its working wrong. when im pressing the "undo" button all the text of the richTextBox is deleted (even if my last action was to delete only...
18
by: Darryl Kerkeslager | last post by:
I don't do much with subforms - in fact I've deliberately avoided them - but .... I have a tab control that will contain several subforms, each bound to a separate table, and each table/subform...
2
by: Leslie | last post by:
On a form, I create a record and save, and am ready to enter another. I decide to Quit the form which executes an "Undo" in case there is data entered. This then tries to "delete" my just saved...
4
by: lesperancer | last post by:
I've got a comboBox with 2 choices and based on the choice, I make button A or button B visible if choose choice 1, button A is visible now, I undo the choice so that the comboBox is null, but...
4
by: jamesnkk | last post by:
I have a list box which show all the Supplier PO Numbers, on the Right of the list box there is a command button called "Add", If user click the "Add' Button it will create a new PO ...
5
by: Steve | last post by:
I have created my own context menu. Everything works except undo'ing deleted text. My code for these two events are: Private Sub tsmiUndo_Click(ByVal sender As Object, ByVal e As...
1
by: anupam roy | last post by:
Hi All, I want to perform basic Edit menu functionalities on my custom design surface. While all the Cut/Copy/Paste/Deelete/Select functionalities working fine with code below,Undo/Redo standard...
1
by: Andy B | last post by:
I have the following code: //delete the row in the table that has ID of 1. This line works fine. DataSet.Table.Rows.Find(1).Delete(); //Accept the delete changes to the table. This row returns...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.