我正在使用 System.Data.SQLite(版本 1.0.85.0)连接我的 SQLite 数据库。我想使用 SQLiteConnection.BackupDatabase() 方法创建数据库的备份,但是它抛出 SQLiteException 并显示消息:“不是错误”(重复两次)。这是一些代码:
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。我必须说错误信息有点误导:)