Nii Laryea
Nii Laryea

Reputation: 1221

Where in the Windows phone device is SQLite db file located/stored?

I'm working on a WP8 app involving SQLite. So when the code for creating and populating the database is executed, I want to be sure the db file is really created on the device and also verify its contents using an SQLite browser.

In creating the database, I specified the location ApplicationData.Current.LocalFolder but I've no idea where exactly in the device that points to.

Which location in the device can I find the SQLite db file?

Upvotes: 4

Views: 3429

Answers (2)

Baris Seker
Baris Seker

Reputation: 173

This did not work for me in 8.1. I kept getting "This operation returned because the timeout period expired" error. I used Windows Phone Power Tools: http://wptools.codeplex.com/, which is much easier to use.

Upvotes: 0

Mr D-Code
Mr D-Code

Reputation: 161

Go to Program Files (x86)\Microsoft SDKs\Windows Phone\v8.0\Tools\IsolatedStorageExplorerTool. Go to this folder and run one of the below commands:

ISETool.exe ts xd 8a40681d-98fc-4069-bc13-91837a6343ca c:\data\myfiles command, if you are running the application on emulator. 

ISETool.exe ts de 8a40681d-98fc-4069-bc13-91837a6343ca c:\data\myfiles command, if you are running the application on device. 

The third argument is the application product ID, you can get it in the WMAppManifest.xml file, App tag, ProductId attribute. The product ID of the given example is 8a40681d-98fc-4069-bc13-91837a6343ca.

Now, if everything is okay, you should have a copy of the Isolated Storage content in the c:\data\myfiles; And the database file should be there too. Then you can add your database file in your project with Add Existing Item option.

Remember to change the Copy to Ouput Directory property of the added .sqlite file to Copy if newer.

Upvotes: 6

Related Questions