SQL Express 2005 won't save any data

Can someone please help me   I am so stuck.

I've constructed the example in Help 5 times and the 16 part learning series (section 9) 9 or 10 times, and cannot get the Data Grid View or Details View drag and drop database to do anything other than display data.  They simply will not save any data at all.

To answer your question, I have created the table, entered sample data and hooked up the data source.

I followed directions to the very letter.

Funny thing: The downloaded sample file from section 9 of the 16 part learning series runs perfectly.


Answer this question

SQL Express 2005 won't save any data

  • Bradonline

    Dear Mr. Hoag,

    Thank you so much for your reply to my post!  On my machine I got an error with the setting (probably there is a workaround) but with a very slight modification it works like a charm.  Would have never thought of it.  In Properties, I set the Copy to Output Directory to Copy if newer.  That updates (so far - knock on wood) both the .mdf permanent data file in the default (working) directory and the .bin directory.

    Thank you very much!  I was absolutely at a standstill before your information.

    Bob


  • shanki

    This is happening because there are actually two copies of the database - one in the project directory and one in the .bin directory. The data is being saved - it just isn't being saved where you would expect.

    The following blog entry provides a great explanation and a couple of workarounds:

    http://blogs.msdn.com/smartclientdata/archive/2005/08/26/456886.aspx

    Hope this helps,
    < xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />Steve Hoag MSFT



  • GameCi

    I'm stuck with the very same problem.

    Also the downloaded sample file from section 9 DOES NOT save any data!

    What's even more funny: when I use an Access 2000 database everything runs fine!

    Why is this

    Why does the table adapter NOT save any data to an SQL Express database

    I use the following code:

       Dim vliUpdatedRecords As Integer

       Me.Validate()

       Me.PersonBindingSource.EndEdit()

       vliUpdatedRecords =  Me.PersonTableAdapter.Update   (Me.MyDataSet.Person)

       MessageBox.Show(vliUpdatedRecords.ToString)

    I get a messagebox displaying the exact number of updated records, but it seems that only the dataset has been updated and not the database itself.

    Werner


  • asifbhura

    Personally, I opted to keep the DB file seperate of my project. That way it works the same no matter what. I also keep a backup of it, just in case
  • Gabeh

    Did you catch Mr. Hoag's kind and extremely helpful answer to the problem   I never would have thought of it, myself.  What worked even better for me (at least so far) was to select the .mdf file then, in Properties, set the Copy to Output Directory to Copy if newer.  On my machine, that updates both the .mdf permanent data file in the default (working) directory and the .bin directory.  Don't know why, and, at this point, I really don't care.  Hope this solves your problem.
  • SQL Express 2005 won't save any data