0

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

2
Contributors
1
Reply
11
Views
3 Years
Discussion Span
Last Post by peter_budo
1

Not working is rather bad description. If you post any error/crashes you gettng perhaps someone may help you...

Votes + Comments
same feeling with you
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.