Hello how can i clear the ChangeSet (GetChangeSet) and get the old Values ..
becouse the user change some data, and on closing form i ask the question, if he want save the data ... when the user say yes the data will be saved. When the use say "No" the data do not save. But when i close the form again without changed any data, the GetChangeSet shows the old Changes !!!
.GetChangeSet().Inserts.Clear is not possible ..
Thanks for help
Clear the ChangeSet
One of the possible solutions is to call the DataContext.Refresh(RefreshMode.OverwriteCurrentValues,
db.GetChangeSet.Updates) method. But this code will make a roundtrip to database.
I recommend you to change the code in some way to call the SubmitChanges method only in case
user says "Yes" and simply dispose the context in case user says "No".
db.GetChangeSet.Updates) method. But this code will make a roundtrip to database.
I recommend you to change the code in some way to call the SubmitChanges method only in case
user says "Yes" and simply dispose the context in case user says "No".