I have an UWP app and want to backup it's database to One drive actually I'm using sqlite for UWP with EF7 RC1.
All I want is a copy from my database to OneDrive to sync it between devices but i'm totally lost, Can't find the database on my win10 mobile.
What is the .db location on my W10 mobile? Wich one is the best OneDrive API's for W10 ? There is a sample where i can read some info ?
Your database should be in your application local storage.
On desktop, to find it, In Visual Studio, open your Package.appxmanifest file, open the Packaging tab and copy the package name.
Open your file explorer, navigate to the folder C:\Users\userName\AppData\Local\Packages. (don't forget to replace userName by your real user name. Then search for folder containing your package name.
If you open the folder LocalState you should find your database file.
To access it through code (will work on phone also):
var folder = ApplicationData.Current.LocalFolder;
var files = await folder.GetFilesAsync();
var dbFile = files.FirstOrDefault(x => x.Name == "myDatabase.db");
If your database is created before your application deployment, your database will be deployed in your application install folder: to find it use var folder = Windows.ApplicationModel.Package.Current.InstalledLocation;
For OneDrive API, you have some samples there:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With