Search code examples
databasesqlitewindows-phone-8upgrade

Windows Phone 8 SQLite database Upgrade


Our Wp8 application using Sqlite for the database. We have a closed beta version that we recently update.

Our problem is, when we modify the database, and the user update the app, they got exception because of the difference. So somehow we need to store the database version, and upgrade that when newer is awailable.

What is the best/ easiest way to do that?


Solution

  • In Android, this is handled with the SQLiteOpenHelper class, which stores a version number in the database (using PRAGMA user_version) and has onCreate/onUpdate callbacks for the app to handle these cases.

    Look at the source and implement something similar.