Newbie: Undo DataSet change?

  • Thread starter Thread starter Sal Bompensaro
  • Start date Start date
S

Sal Bompensaro

Hi,

I have a super-basic question for you:

I have a typed DataSet which contains several tables. Throughout my
WinForms app, the user has a chance to modify this dataset and submit these
changes to the server. Prior to submission, the user will be given the
option to "Save Changes" or "Revert to Old"... In the latter case, I want
the DataSet to revert back to the way it looked at the last save point. If
the user chooses to save, I'll submit the DataSet to the server and the user
can then continue making changes to the revised DataSet.

Bottom line: The user will only need to "undo" back to the last save
point. I don't want or need the user to be able to undo the DataSet to the
state PRIOR to the last save.

So my question is: How do I pull this off? After I've submitted the
DataSet to the server, what method do I call against the DataSet to tell it
that we've reached a save point? On the converse scenario, when a user wants
to revert, how do I tell the DataSet to revert to the prior save point?

Also, how do I clone a DataSet? The documentation shows a Clone()
method, but this only copies the schema, not the actual DataSet.

Dr. Tyrone Jackson
 
Sal Bompensaro said:
Hi,

I have a super-basic question for you:

I have a typed DataSet which contains several tables. Throughout my
WinForms app, the user has a chance to modify this dataset and submit
these
changes to the server. Prior to submission, the user will be given the
option to "Save Changes" or "Revert to Old"... In the latter case, I want
the DataSet to revert back to the way it looked at the last save point. If
the user chooses to save, I'll submit the DataSet to the server and the
user
can then continue making changes to the revised DataSet.

Bottom line: The user will only need to "undo" back to the last save
point. I don't want or need the user to be able to undo the DataSet to the
state PRIOR to the last save.

So my question is: How do I pull this off? After I've submitted the
DataSet to the server, what method do I call against the DataSet to tell
it
that we've reached a save point?

Dataset.AcceptChanges()

On the converse scenario, when a user wants
to revert, how do I tell the DataSet to revert to the prior save point?
Dataset.RejectChanges()

Also, how do I clone a DataSet? The documentation shows a Clone()
method, but this only copies the schema, not the actual DataSet.
Dataset.Merge()

David
 
Your three sentence response will serve as the backbone of my entire
project. Thank you, sir! :)
 
Back
Top