簡體   English   中英

System.Data.SQLite BackupDatabase()拋出“不是錯誤”

[英]System.Data.SQLite BackupDatabase() throws “not an error”

我正在使用System.Data.SQLite(版本1.0.85.0)來連接我的SQLite數據庫。 我想使用SQLiteConnection.BackupDatabase()方法創建數據庫的備份,但是它會拋出SQLiteException並顯示消息:“not an error”(重復兩次)。 這是一些代碼:

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。 我必須說錯誤信息有點誤導:)

我使用相同的方法來執行方法,但作為數據庫名稱,我使用main

cnnIn.BackupDatabase(cnnOut, "main", "main", -1, null, -1);

它適用於這種變化嗎?

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM