首页 > 其他 > 详细

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

时间:2019-06-10 19:18:04      阅读:104      评论:0      收藏:0      [点我收藏+]

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

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

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

  

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

原文:https://www.cnblogs.com/zitjubiz/p/10999560.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!