Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

Export sqlite db to a user's choice location on a device and import db file

$
0
0

I am using Xamarin to create a database if none existing.
public partial class App : Xamarin.Forms.Application
{ static BusinessDB database;
public static BusinessDB Database
{get {
if (database == null)
{database = new BusinessDB(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "BusinessDB.db3"));}
return database; } }

The Xamarin program then creates, updates, and uses tables in this SQLite database as needed.

I am wanting to create a Backup/ Import page that allows users to upload a database or download a database backup. When uploading a database that may have a name different than BusinessDB, such as Backup01012020CompanyXDB.db3, what should I do?

I want the user to have an option of where to save a backup, and also the ability to pick a database for import. Is there simple cross platform code suitable for this?

I am a newbie, but so far I am loving learning :)


Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>