Installing new version of Sqlite looses the database RRS feed

  • General discussion

  • Hi ,

    I have built a metro UI c# app with sqlite database support.

    Does anyone face the issue after installing the new sqlite version (any version) , looses the database data after the first connect ??? Is there any way to avoid this because users are going to loose their data.

    Does anyone has an idea on how to resolve this ?

    Appreciate any help you could give me on this.

    thank you

    Wednesday, December 11, 2013 2:35 PM

All replies

  • You shouldn't have a problem with this. Make sure your app isn't overwriting the database when it updates and doesn't change its schema without conversion.

    Without knowing how your app works it is difficult to provide more specific help.


    Wednesday, December 11, 2013 4:11 PM
  • Hi Rob ,

    I'm doing the below

    var db = new SQLite.SQLiteConnection("my path");

    db.RunInTransaction(() =>

                        MySearchCompanies = db.Query<MyApp.App.tbSearchCompanies>("select * from tbSearchcompanies");


    I believe the new Sqlite.SqliteConnection causes the issue.

    I will take a closer look and revert Rob.

    thank you

    Wednesday, December 11, 2013 5:23 PM
  • Hi Rob , 

    No it is not the new sqlite connection.

    When the App launches I'm running the below line of code

     this.dbpath = Path.Combine(Windows.Storage.ApplicationData.Current.LocalFolder.Path, "mydatabase.db");

    And then 

      StorageFolder storageFolder = ApplicationData.Current.LocalFolder;

     StorageFile databaseFile = await storageFolder.GetFileAsync("mydatabase.db");

    Does this Path.Combine causes the issue ??

    Perhaps needs to check first if the database file exists ?????

    thank you

    Wednesday, December 11, 2013 5:57 PM
  • You were right Rob. Found the bug just a few lines below. I'm sorry.

    Thank you 

    Wednesday, December 11, 2013 6:23 PM