How to deploy SqlCe Database into isolatedStorage for windows phone

↘锁芯ラ 提交于 2019-12-04 08:59:43

You can include the database file as Content in your application project and it will then be put in your XAP at build time and copied to your application install directory on the phone.

Will you modify this database at all?

  • If not: you can access the database directly from the install directory and future updates will get any new version of the database automatically (as long as you remember to add them to the XAP).

  • If you do modify it: then on first install you will need to copy the database to isolated storage before you use it. You will need to watch out if you update the database scheme with a future update.
  • Usually the pattern is to create the database and to configure seed data with it.

    Alternatively, if the database is read-only, you can deploy it with your application. See How to: Deploy a Reference Database with a Windows Phone Application on MSDN.

    If you want to deploy a database from your development machine for testing purposes, you can use the the ISETool that can take and restore snapshots of an application's isolated storage to/from a local directory:

    # Copy data from IS to directory
    ISETool.exe ts xd <PRODUCT-ID> "C:\TempDirectory\IsolatedStore"
    
    # Copy data to IS from directory
    ISETool.exe rs xd <PRODUCT-ID> "C:\TempDirectory\IsolatedStore"
    
    易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
    该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!