我正在使用System.Data.SQLite(版本1.0.85.0)來連接我的SQLite數據庫。我想使用SQLiteConnection.BackupDatabase()方法創建數據庫的備份,但是它會拋出SQLiteException消息:「沒有錯誤」(重複兩次)。下面是一些代碼:System.Data.SQLite BackupDatabase()拋出「沒有錯誤」
SQLiteConnection cnnIn = new SQLiteConnection("Data Source=test.db;foreign keys=True");
SQLiteConnection cnnOut = new SQLiteConnection("Data Source=backup.db;foreign keys=True");
cnnIn.Open();
cnnOut.Open();
cnnIn.BackupDatabase(cnnOut, "backup", "test", -1, null, -1);
cnnIn.Close();
cnnOut.Close();
這個錯誤來自System.Data.SQLite.SQLite3.InitializeBackup(SQLiteConnection destCnn, String destName, String sourceName)
有誰知道什麼可能是錯誤的?
PS。我必須說,錯誤信息是有點誤導:)
'拋出「沒有錯誤」' - 真棒。 –