Reputation: 1755
I have successfully followed the instructions to work with SQLite databases in a Universal Windows Platform application, as explained here: "Use a SQLite database in a UWP app"
That tutorial shows how to create a new SQLite database, with C# code, in the application's local data store, but it does not explain how to put an existing SQLite database into the local data store.
Upvotes: 0
Views: 189
Reputation: 7727
how to put an existing SQLite database into the local data store.
The database is also a db file, so this question can be translated into how to copy file to local storage.
Here is the code:
public async Task<StorageFile> CopyFileToLocalStorage(StorageFile dbFile)
{
var localFolder = ApplicationData.Current.LocalFolder;
var localFile = await dbFile.CopyAsync(localFolder, "sqliteSample.db",NameCollisionOption.ReplaceExisting);
return localFile;
}
Best regards.
Upvotes: 2