locked
How to deploy WinRT App with SQLite to Surface WinRT device RRS feed

  • Question

  • I am very confused in deploying SQLite DB to Surface WinRT , Surface Pro WinRT or Win8 Pro.

    Hope some1 can help to answer the following questions:

    in VS for win8, I created SQLite DB and tables in Emulator in Win8 pro (LapTop) and populated data in it thru Web Service in Emulator :

    now I need to deploy it to Surface WinRT:

    1) When create app Package in Win8 Pro Laptop for WinRT (ARM) for deployment, I select ARM for WinRT device.

    will the Data in the tables be gone once the App installed ? in my case, it seems like it.

    2) The same question for Surface pro WinRT tablet.


    Thanks


    • Edited by FireDance Friday, December 6, 2013 2:46 AM typo
    Friday, December 6, 2013 2:44 AM

Answers

  • Each deployment is separate, so data inserted at runtime in one instance won't be available in others.

    If you want to load data at runtime and then deploy that same data you would need to fill the database and then copy the filled one back into the project to rebuild.

    --Rob

    • Marked as answer by Anne Jing Monday, December 16, 2013 9:44 AM
    Saturday, December 7, 2013 12:41 AM
    Moderator

All replies

  • I'm not sure exactly what you mean by "Surface WinRT , Surface Pro WinRT or Win8 Pro" (these each mix up parts of names that mean contradictory things), but the platform doesn't matter. These will all act the same and the database's contents will depend on how you deploy the database.

    If you include a database file in your appx package then it will install with whatever data is in that table. The installation directory isn't writable, so you will need to copy it to the app data directory before saving to it.

    It is your choice to deploy a database with existing data or to deploy (or create) an empty database and then fill it with data from the web service.

    The only platform difference is that since SQLite is a native DLL you will need to have different versions compiled for x86 and for ARM (and potentially x64). If you are getting different behavior beyond that for different targets then you may not have the projects set up the same for all targets.

    --Rob

    Friday, December 6, 2013 2:52 AM
    Moderator
  • Here the scenario:

    1) As per your suggestion

    If you include a database file in your appx package then it will install with whatever data is in that table. The installation directory isn't writable, so you will need to copy it to the app data directory before saving to it.

     This is ok

    2) Create SQLite DB and tables and insert data into tables thru web services in Emulator  in PC, then later deploy to WinRT device.

    - this is the one I have problem. What I mean is that whatever data get in to SQLite Tables using emulator will be gone after deploying it to WinRT-device.

    Thanks


    • Edited by FireDance Friday, December 6, 2013 5:22 AM typo
    Friday, December 6, 2013 4:04 AM
  • Each deployment is separate, so data inserted at runtime in one instance won't be available in others.

    If you want to load data at runtime and then deploy that same data you would need to fill the database and then copy the filled one back into the project to rebuild.

    --Rob

    • Marked as answer by Anne Jing Monday, December 16, 2013 9:44 AM
    Saturday, December 7, 2013 12:41 AM
    Moderator