SQLite ExecuteNonQuery之后不允许我关闭连接

时间:2017-02-18 08:34:56

标签: c# sqlite

myConnection = new SQLiteConnection(...)
string query = "INSERT INTO Account(col1, col2, col3) VALUES(\"test\", \"some\", \"thing\")";
SQLiteCommand command = new SQLiteCommand(query, myConnection);
myConnection.Open();
command.ExecuteNonQuery();
myConnection.Close();

运行调试器,代码进入command.ExecuteNonQuery(),然后永远不会命中myConnection.Close()。这有什么特别的原因吗?

使用Insert语句运行查询从不允许我关闭连接,但将查询更改为“select * from table”工作正常。

0 个答案:

没有答案