记录一次ef报错解决
报错信息:
There is already an open DataReader associated with this Connection which must be closed first
System.InvalidOperationException: 意外的连接状态。在使用包装提供程序时,请确保在已包装的 DbConnection 上实现 StateChange 事件
解决方法:
原代码

新代码

加个using释放一下ef的连接就好了
报错信息:
There is already an open DataReader associated with this Connection which must be closed first
System.InvalidOperationException: 意外的连接状态。在使用包装提供程序时,请确保在已包装的 DbConnection 上实现 StateChange 事件
解决方法:
原代码

新代码

加个using释放一下ef的连接就好了