locked
How to use the pre existing sqlite database

    Question

  • How to use the pre existing sqlite database and in my application to modify the database. It would be better if you can answer with sample code.

    I am creating a demo application and i manually feeding data using sqlite database. I want to initially load Sqllite database without launching my app. When my app launches it should use the existing sqllite database.


    Purushothama V S

    Friday, May 8, 2015 11:16 AM

Answers

  • You can include the pre-configured database in your appx package and then copy it to the application data before using it. The appx package is not writeable when the app is deployed.

    There is no way to point the app to use a SQLite database outside of its application data (or appx package). The way SQLite opens the database requires direct access, so it must be in one of those locations. You can allow the user to pick a database with a file picker and then copy that to the local data.

    This question has been asked frequently and there are lots of threads explaining it with sample code if you search the forum.
    Friday, May 8, 2015 7:19 PM
    Moderator