捕捉到 System.InvalidOperationException
_HResult=-2146233079
_message=意外的连接状态。在使用包装提供程序时,请确保在已包装的 DbConnection 上实现 StateChange 事件。
HResult=-2146233079

解决参考:

https://stackoverflow.com/questions/4867602/entity-framework-there-is-already-an-open-datareader-associated-with-this-comma

https://stackoverflow.com/questions/20693216/there-is-already-an-open-datareader-associated-with-this-connection-which-must-b

EF There is already an open DataReader associated with this Command的更多相关文章

  1. There is already an open DataReader associated with this Command which must be closed first." exception in Entity Framework

    Fixing the "There is already an open DataReader associated with this Command which must be clos ...

  2. 在实体对象中访问导航属性里的属性值出现异常“There is already an open DataReader associated with this Command which must be closed first”

    在实体对象中访问导航属性里的属性值出现异常“There is already an open DataReader associated with this Command which must be ...

  3. 关于MultipleActiveResultSets属性导致的There is already an open DataReader associated with this Command which must be closed first的解决方法

    执行SqlDataReader.Read之后,如果还想用另一个SqlCommand执行Insert或者Update操作的话,会得到一个错误提示:There is already an open Dat ...

  4. C#.net mysql There is already an open datareader associated with this command引发的问题

    [参考]There is already an open datareader associated with this command引发的问题 我在语句中并未使用 DataReader,未何也提示 ...

  5. 多线程下,多次操作数据库报错,There is already an open DataReader associated with this Command which must be closed first.

    原文:https://www.cnblogs.com/sdusrz/p/4433108.html 执行SqlDataReader.Read之后,如果还想用另一个SqlCommand执行Insert或者 ...

  6. error 'there is already an open datareader associated with this command which must be closed first'

    This can be easily solved by allowing MARS in your connection string. Add MultipleActiveResultSets=t ...

  7. There is already an open DataReader associated with this Command which must be closed first

    通常出现在嵌套查询数据库(比如在一个qry的遍历时,又进行了数据库查询) 通过在连接字符串中允许MARS可以轻松解决这个问题. 将MultipleActiveResultSets = true添加到连 ...

  8. EF 常见异常总结

    问题:System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invoca ...

  9. EF core 性能调优

    Entity Framework Core performance tuning – a worked example Last Updated: February 25, 2019 | Create ...

随机推荐

  1. vins-mono调试教程

    https://www.cnblogs.com/Jessica-jie/p/6950604.html

  2. [No0000123]WPF DataGrid Columns Visibility的绑定

    场景:根据配置文件显示DataGrid中的某些列. 问题:Columns集合只是DataGrid的一个属性,这个集合在逻辑树或视觉树中是看不到的,也不会继承DataContext属性. 方法一:对Da ...

  3. [No0000F3]C# 结构(Struct)

    在 C# 中,结构是值类型数据结构.它使得一个单一变量可以存储各种数据类型的相关数据.struct关键字用于创建结构. 结构是用来代表一个记录.假设您想跟踪图书馆中书的动态.您可能想跟踪每本书的以下属 ...

  4. 创建本地SVN版本库以及将SVN导入GIT

    创建本地SVN 通常SVN作为一种服务,是在服务器上架设,供用户通过网络访问使用.但如果只是自己日常使用,完全可以架设在本机上,不需要启动后台程序,通过文件的方式访问即可. 建立本地SVN非常简单,一 ...

  5. mac休眠掉电快,更改休眠模式

    打开终端输入: $ pmset -g 查看休眠模式 hibernatemode 发现值为3, 这是大多数的设置,如果为0 ,那么休眠时严重掉电, 我们可以改变这个模式: $ sudo pmset -a ...

  6. 自己写的JdbcUtils小工具-----得到Connection对象

    Properties文件中存放键值对------(可看对Properties文件的解析) static代码块是在构造函数之前执行的,而且只执行一次,即类首次加载时. 也就是只加载一次配置文件和加载数据 ...

  7. AndroidsStudio_找Bug

    新版本不再提供Android Monitor,但在Logcat中可以找到运行日志,但在Regex中要勾选Show only... 另外设置一个控件记得加id.

  8. scala-数组/列表

    import scala.collection.mutable.ArrayBuffer var ary=Array(1,2,3) println(ary.mkString) println(ary(1 ...

  9. 【PyQt5-Qt Designer】pyqtSignal()-高级自定义信号与槽

    PyQt 5信号与槽的几种高级玩法 参考:http://www.broadview.com.cn/article/824 from PyQt5.QtCore import QObject , pyqt ...

  10. Nand Flash 驱动框架

    框架入口源文件:s3c_nand.c (可根据入口源文件,再按着框架到内核走一遍) 内核版本:linux_2.6.22.6   硬件平台:JZ2440 以下是驱动框架: 以下是驱动代码 s3c_nan ...