ExecuteNonQuery requires an open and available Connection. The connection's current state is closed.
摘要:
今天调试一个监控程序,放到环境里发现不写库,于是给SQL执行类异常事件做了个日志,发现报:ExecuteNonQuery requires an open and available Connection. The connection's current state is closed.左看右看,没问题呀,后来才想起,using里没有执行db.Open,打开数据库连接。 public class SQLHelper : IDisposable { private IntPtr handle; private readonly Component com... 阅读全文