【发布时间】:2010-05-21 00:28:52
【问题描述】:
我在使用存储过程时遇到问题,执行后我无法提交。 它显示此错误“[System.Data.Odbc.OdbcException] = {”ERROR [HY000] [MySQL][ODBC 5.1 Driver]Commands out of sync;你现在不能运行这个命令"}"
SP 本身运行良好。 有人知道会发生什么吗?
谢谢。
更新:在 C# 中,我在提交之前没有关闭阅读器。
OdbcDataReader reader = cmd.ExecuteReader();
if (reader.Read())
{
result = Convert.ToBoolean(reader[0]);
}
reader.Close(); //this line was not here when I had the error
cmd.Transaction.Commit();
【问题讨论】: