Well, The problem is that I have a SQLLITE database file which has data and can be browsed in SQLITE browser. I want this file to be imported in my windows phone app so that I can bind my Lists.
I have been googling and trying for a solution but no luck yet.
public async void UpDatabase()
{
bool isDatabaseExisting = false;
try
{
StorageFile storageFile = await ApplicationData.Current.LocalFolder.GetFileAsync("DTEMPCounselling");
isDatabaseExisting = true;
}
catch
{
isDatabaseExisting = false;
}
if (!isDatabaseExisting)
{
StorageFile databaseFile = await Package.Current.InstalledLocation.GetFileAsync("DTEMPCounselling");
await databaseFile.CopyAsync(ApplicationData.Current.LocalFolder);
}
}
Problem with above code is it searches it in the emulator filesystem while my database file is in my C: drive.
Any suggestion how can I achieve this. Thanks.
The code I used here was all right. But the real cause of the problem was the idea that the Emulator and the hosting machine work as two different systems. Means, to be able to read the database file in Emulator it should have been placed in Emulator's file system.
Putting the file in Emulator's file system solved the problem.