Results 1 to 1 of 1

Thread: Clearing DataSet doesn't work after closing and loading form

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jul 2010
    Posts
    21

    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.
    Last edited by roobbke; Sep 29th, 2010 at 04:35 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width