0

I would like to load a prefab sqlite database from the folder Assets at the launch and copy it in the localstate of the application.

I try a lot of thing and every time I have a "Access denied" or "file not found".

Have you any idea how to do it ?

Regards

2
  • 2
    Can you post some of your code? Commented Mar 12, 2013 at 21:10
  • Do you have it stored in a folder such as Program Files which requires Administration Rights and UAC Permission to invoke? Commented Mar 12, 2013 at 21:16

1 Answer 1

3

This is a weird quirk for Win 8 RT. I might guess that you have a special extension for your Sqlite db, like ".db" ... a workaround I have used is to use a ".txt" extension for the db in assets.

This works on my system without corrupting the file. I checked the db in Sqlite Database Browser.

StorageFile file = await StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///Assets/db_in_assets.txt"));

await file.CopyAsync(ApplicationData.Current.LocalFolder, "db_in_local.db");
Sign up to request clarification or add additional context in comments.

1 Comment

that's work. I tried with extension "db" and that didn't work. Thanks a lot

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.