Clearing DataSet doesn't work after closing and loading form
Hello everyone! So I'm using visual studio 2010. Created and filled with data a local database (SQL server compact 3.5). When I load form, on my DGV I can do whatever I want - delete, add, edit rows, then save changes.
I made a button to remove these changes and reset DataSet:
Code:
Private Sub APPToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles APPToolStripMenuItem.Click
SarasasDataSet.Clear()
Me.SarasasDataSet.AcceptChanges()
Me.Validate()
Me.KandidataiBindingSource.EndEdit()
Me.Close()
End Sub
The problem is this: I edit DGV and close a form (after saving). Then load form again (changes a left - it's ok), but when I try to clear DataSet in order to load my original DataTable on DGV - it clears, but DataSet after loading form DGV doesn't show original DataTable, but shows changed data . I can make it only when manually refreshing connection with database at server explorer window and loading form after.