Saving table

Hello

I am fairly new to this, I have been creating a small application that has come together fine and works, however all data that is stored in my table is lossed when the user exits the program and loads it back up. I presume that I need to have some way of saving the table and loading it up when the program is opened again. I have tried a few things so far with no success, can someone tell me what the best way of doing this would be, and how to go about doing it.

Cheers.



Answer this question

Saving table

  • merk

    hi,

    first you have to call tableAdapter.update(yourDataSet) on your form closing event handler

    second there is a FAQ thread at the top of this forum has answer for this Questions , if you tried both and your project didn't work let us know plz

    hope this helps



  • bbogdanmircea

    Hey Mike,

    I'm glad you asked as what it sounds like is a confusing default for SQL Server Express. I actually just blogged about this as I think more people get stuck on this and don't understand what's going on.

    The short answer is that by default, SQL Server Express will always copy over the database when you're debugging. You can change this by selecting the database in the properties window, select the "Copy to Output directory" and change "copy always" to "Copy if newer" and see if that fixes your issue.

    Best of luck,

    Dan Fernandez
    Lead Product Manager
    Visual Studio Express
    http://blogs.msdn.com/danielfe/


  • Mbd

    hi,

    Is your problem solved If yes then please mark the reply as answer.

    Thank you,
    Bhanu.



  • mikebk

     

    Welcome Robert,

    What database product are you using Could you take a quick look at the Post above called How to receive the Optimal Answer for your Question



  • Saving table