.NET SQLite提供程序无法再找到我的表

时间:2012-09-07 10:22:02

标签: c# .net sqlite system.data.sqlite

早些时候我曾经跑过:

using (SQLiteConnection sqlite_connection =
    new SQLiteConnection("Data Source="
        + armc.Model.Settings.dbpath
        + ";Version=3;New=True;Compress=True;")) {
    sqlite_connection.Open();
    SQLiteCommand sqlite_command = sqlite_connection.CreateCommand();
    sqlite_command.CommandText = "select * from `archive`"; // ???
    SQLiteDataReader sqlite_datareader = sqlite_command.ExecuteReader();
    while (sqlite_datareader.Read()) {
        m_products.Add
            (new Product("val", int.Parse(sqlite_datareader["value"].ToString())));
        }
    }

但现在我得到了:

$ exception {“SQLite错误\ r \ nno这样的表:archive”} System.Exception {System.Data.SQLite.SQLiteException}

我不明白发生了什么变化,但我仍然可以使用C ++ api和使用SQLite 2009 Pro util来使用sqlite,但.NET 4.0的.NET提供程序出了问题。

曾尝试更改数据库,保存为RSA,似乎到目前为止没有任何事情发生,可能会出现什么情况?

1 个答案:

答案 0 :(得分:1)

new SQLiteConnection("Data Source="
        + armc.Model.Settings.dbpath
        + ";Version=3;New=True;Compress=True;"))

将Property New设置为False

相关问题