Results 1 to 3 of 3

Thread: [RESOLVED] info not saving in a database

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2010
    Posts
    2

    Resolved [RESOLVED] info not saving in a database

    I created a database in access 2007, linked it to my project in visual studio 2008 (vb). When I enter some data using the UI, it does not save it in the database, and it's gone as soon as I run the program again. I dragged the textboxes from the datasource panel, onto the UI.... any ideas?



    this is the code that was automatically generated by vs for the save button:

    Code:
    Private Sub StaffBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles StaffBindingNavigatorSaveItem.Click
            Me.Validate()
            Me.StaffBindingSource.EndEdit()
            Me.TableAdapterManager.UpdateAll(Me.GartisDataSet)
    
        End Sub

  2. #2
    Junior Member
    Join Date
    Feb 2010
    Posts
    17

    Re: info not saving in a database

    ok what you have to do first is to create your data set

    go to data create new data set(im assuming you did this)

    select your database name change your data set name select the table you want to work with, finish

    first of all you need to erase all the controls that you may have when you dragged your datasource before erase the data set, the binding source, table adapter, table adapter manager, and binding navigator.

    now go to data show data sources press + in the data set you created
    now you showld see the table you created press the drop down box and select details
    now drag and drop to your table it shold create a navigation panel and the text boxes with the info in your DB you can manage the info using the nav panel you can add delete save the data from there

  3. #3

    Thread Starter
    New Member
    Join Date
    Apr 2010
    Posts
    2

    Re: info not saving in a database

    got it.... it was working fine, when launching the app via vs, it copies a db file every time, so the data is removed, after launching it from debug/release folder, it works fine

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