码迷,mamicode.com
首页 > 其他好文 > 详细

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

时间:2016-04-08 21:48:32      阅读:255      评论:0      收藏:0      [点我收藏+]

标签:

当我开启惰性加载情况下,系统会报此异常信息,出现此异常是发生于Sql server 2005.

解决方法:在数据库连接字符串中添加MARS信息为true

 

<add name="CRGDatabase" connectionString="Data Source=./;Initial Catalog=DB;uid=User;pwd=Pwd;MultipleActiveResultSets=true;" providerName="System.Data.SqlClient"/>

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

标签:

原文地址:http://www.cnblogs.com/gary-shao/p/5369955.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!