sql >> Databasteknik >  >> RDS >> SQLite

importera redan skapad SQLite-databas (xamarin)

string localPath = Path.Combine(System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal), YourAppName);

//Directory with your DB3 file
var dirx = Android.OS.Environment.ExternalStorageDirectory.ToString();

// DB File 
var dbfile = System.IO.Path.Combine(dirx , "/YourAppName/YourSQLiteDB.db3");



            if (File.Exists(dbfile))
            {

                File.Copy(dbfile, localPath, true);
                Toast.MakeText(this, "SQLiteDB copied successfully!", ToastLength.Long).Show();


            }
            else
            {
                Toast.MakeText(this, "copy from " + diry +         System.Environment.NewLine + "to " + localPath + " failed or source file is missing!", ToastLength.Long).Show();
            }
}



  1. Hur migrerar man en PostgreSQL-databas till en SQLServer-databas?

  2. Hur man begränsar resultat i Oracle

  3. Hur man skapar en offline-app för internationalisering:Stöd flera språk

  4. bbPress:Hur man hittar mappningar av bilagor till deras respektive inlägg