I'm trying to import an excisting SQLitedatabase in my Windows Universal project.I followed along this tutorial. Which does just what I want. However it states:
then copy the database with a .sqlite extension to the root of the shared project in your universal app.
So I added my excisting databse to the root of my Shared Project
However when I try the following code I get an IOException the File could not be found.
private async Task CopyDatabase()
{
bool isDatabaseExisting = false;
try
{
StorageFile storageFile = await ApplicationData.Current.LocalFolder.GetFileAsync("FixedCamerasOK.sqlite");
isDatabaseExisting = true;
}
catch(Exception ex)
{
isDatabaseExisting = false;
}
if (!isDatabaseExisting)
{
StorageFile databaseFile = await Package.Current.InstalledLocation.GetFileAsync("FixedCamerasOK.sqlite");
await databaseFile.CopyAsync(ApplicationData.Current.LocalFolder);
}
}
So where do I place the .sqlite file so it can be found.
Aucun commentaire:
Enregistrer un commentaire