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

通常出现在嵌套查询数据库(比如在一个qry的遍历时,又进行了数据库查询)

通过在连接字符串中允许MARS可以轻松解决这个问题。 将MultipleActiveResultSets = true添加到连接字符串的提供程序部分

    "SqlServerConnection": "Server=.\\sqlexpress;Database=test;Integrated Security=True;Connect Timeout=15;MultipleActiveResultSets=true",

  

上一篇:sql server2005的死锁


下一篇:Swift: Associated Types