tableadapter insert not saving in database RRS feed

  • General discussion

  • I have   done this   Highlight the database in Solution Explorer -> right click on your database (.mdf) file -> select Properties -> change the "copy to ouput directory" to "copy if newer".

    I have my  database within the application  BDHERGAIM.mdf------  I have my dataset  and tableadaters fixed good and I have this simple code whicho seems to be good.



    Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click



    Dim s As Integer


    Dim d As Date

    d = Now()

    TbboletinesTableAdapter1.Insert(1, 2, d)



    s = TbboletinesTableAdapter1.ScalarQuery/// number of registrys in the table... simple count

    MsgBox(s)/// when it prompts it raises every time I click the button  so it appears to be inserting in the data table

    end sub
    After I close the application I check the table tbboletines in which I supposedly inserted data and still the same....NO CHANGES IN THE DATABASE

    What could be wrong? Thank you for any help and your time.
    • Moved by VMazurModerator Friday, November 6, 2009 11:10 AM (From:ADO.NET Data Providers)
    • Changed type Yichun_Feng Thursday, November 12, 2009 2:26 AM ....
    Thursday, November 5, 2009 6:42 PM

All replies

  • Hi,

    Can you try setting it to copy always and see if it works?

    Saturday, November 7, 2009 4:49 PM
  • Hi reyfon,


    We are changing the issue type to “Comment” because you have not followed up with the necessary information. If you have more time to look at the issue and provide more information, please feel free to change the issue type back to “Question” by editing your initial post and changing the radio button at the top of the post editor window. If the issue is resolved, we will appreciate it if you can share the solution so that the answer can be found and used by other community members having similar questions.



    Best Regards

    Yichun Feng

    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    Thursday, November 12, 2009 2:25 AM