Amazon-Enabled Movie Collection

I've downloaded the web-enabled MovieCollection and got it to run, but for some reason, it does not save any of the data.  I type in movie names but as soon as I exit the program and restart it, the data is gone.  What could be the problem

Answer this question

Amazon-Enabled Movie Collection

  • Paulo Cardoso

    I'm still trying to get this to work, but no luck.  I've set breakpoints in the save processing and they get hit as I expected.  The rowsSaved variable in ListDetails shows a value of 1, indicating that 1 row was updated. 

    It sort of looks like the data is not being committed to the database, but I can't determine if that's the problem.

    Any pointers on how to troubleshoot this would be appreciated.

  • Maxime LABELLE

    Hi,

    Please try this as a workaround:
    - click on DVDCollectionDatabase.mdf file in Solution Explorer
    - view Properties in the Property Grid
    - change the Copy to Output property from Copy always to Do Not Copy
    - press F5, make changes, Stop, press F5 again.

    I suspect you will see your data changes from now on.

    This is caused by a file copying behavior with local data files that is described in more detail here:
    http://blogs.msdn.com/smartclientdata/archive/2005/08/26/456886.aspx

    hope this helps.

    --Paul


  • Rich Howard

    Hi,

      By default VStudio overwite the datafile every time you run the app. Try run it outside VS. Insert some data, and exit, then open it up again outside VS. The data should be there.

      In the Solution Explorer you can ask for properties of the data file, theres an option to change this behavior. Can't recall excatly now, but should be easy to find.

  • Alexander Medvedev

    That was it!  The only additional step required was to manually copy the database file to the ...\bin\debug folder.  After changing the property and running with F5, I got a message that it could not find the database file in that folder. 

    I assume that this is a feature that allows the developer to "roll-back" the database to a known state for test purposes for each run.

    Thanks for the response - it was right on target!

    Bob B.

  • hugo s

    You bet.  And you're right - the project model has built in roll back functionality so the code you build is the code you ship.  This feature is nice for many things like settings files and resource files, however, it's not always correct for local databases.

     

    --Paul


  • mta37

    Thanks!  Your response, along with the previous posting, fixed my problem.

    I greatly appreciate the assistance.

    Bob B.

  • Amazon-Enabled Movie Collection