Hi All,
I am developing an App for Windows Phone 8.1 called Transport Management System. First up am trying to use Sqlite DB with the App. I was successful in creating New DB, updating and retrieving values from DB. Now, i have tried to use existing Sqlite DB with the app for that i have used the code below. I added existing db in project, Changed Build Action --> content and Copy to Output Directory --> Copy Always in the properties of DB file.
private async Task CopyDatabase()
{
bool isDatabaseExisting = false;
try
{
StorageFile storageFile = await ApplicationData.Current.LocalFolder.GetFileAsync("people.db");
isDatabaseExisting = true;
}
catch
{
isDatabaseExisting = false;
}
if (!isDatabaseExisting)
{
StorageFile databaseFile = await Package.Current.InstalledLocation.GetFileAsync("people.db");
await databaseFile.CopyAsync(ApplicationData.Current.LocalFolder);
}
}
But its not working.What could be the possible error?
Thanks,
Avi