Memory Stream as DB如何使用C#或SQLite的查詢
我已經使用這個鏈接,介紹了代碼,以SQLite數據庫備份我ERRORMESSAGE是
BackupDatabase()不 System.Data.Sqlite存在.SqliteConnection
是否有任何Sqlite查詢來備份或導出Sqlite數據庫。 然後再次恢復它
我想導出數據庫在一個系統上,然後導入到另一個系統中安裝在兩個系統上的相同的Windows應用程序。 我想按鈕點擊實現這個活動。
Memory Stream as DB如何使用C#或SQLite的查詢
我已經使用這個鏈接,介紹了代碼,以SQLite數據庫備份我ERRORMESSAGE是
BackupDatabase()不 System.Data.Sqlite存在.SqliteConnection
是否有任何Sqlite查詢來備份或導出Sqlite數據庫。 然後再次恢復它
我想導出數據庫在一個系統上,然後導入到另一個系統中安裝在兩個系統上的相同的Windows應用程序。 我想按鈕點擊實現這個活動。
試試這個
using (var destination = new System.Data.SQLite.SQLiteConnection(string.Format("Data Source={0}\\DriversTrucksBackup.db; Version=3;", this.txtLocation.Text)))
{
da.cn.Open();
destination.Open();
da.cn.BackupDatabase(destination, "main", "main", -1, null, 0);
da.cn.Close();
}
public void backup(string strDestination)
{
using (var location = new SQLiteConnection(@"Data Source=C:\activeDb.db; Version=3;"))
using (var destination = new SQLiteConnection(string.Format(@"Data Source={0}:\backupDb.db; Version=3;", strDestination)))
{
location.Open();
destination.Open();
location.BackupDatabase(destination, "main", "main", -1, null, 0);
}
}
是否使用的是System.Data.SQLite的版本? –
版本: - SQLite 3.8.11.1。我已經通過Addons將它添加到mozila firefox中。我認爲它僅提供以下功能表,視圖,索引和觸發器。我在SQL Server中考慮的工作更容易,但在Sqlite數據庫中更容易。 – Ajay
3.8.11.1是SQLite庫本身的版本。什麼是C#System.Data.SQLite包的版本? –