解决"There is already an open DataReader associated with this Command which must be closed first." exception in EF 中
2011-12-21 18:37
731 查看
当我开启惰性加载情况下,系统会报此异常信息,出现此异常是发生于Sql server 2005.
解决方法:在数据库连接字符串中添加MARS信息为true
<add name="CRGDatabase" connectionString="Data Source=./;Initial Catalog=DB;uid=User;pwd=Pwd;MultipleActiveResultSets=true;" providerName="System.Data.SqlClient"/>
解决方法:在数据库连接字符串中添加MARS信息为true
<add name="CRGDatabase" connectionString="Data Source=./;Initial Catalog=DB;uid=User;pwd=Pwd;MultipleActiveResultSets=true;" providerName="System.Data.SqlClient"/>
相关文章推荐
- Fixing the "There is already an open DataReader associated with this Command which must be closed first." exception in Entity Framework
- There is already an open DataReader associated with this Command which must be closed first." exception in Entity Framework
- EF "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 closed first."
- 关于MultipleActiveResultSets属性导致的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 closed first的错误解决办法
- LINQ: There is already an open DataReader associated with this Command which must be closed first
- LINQ: There is already an open DataReader associated with this Command which must be closed first
- MySql: There is already an open DataReader associated with this Command which must be closed first.2/16
- LINQ: There is already an open DataReader associated with this Command which must be closed first
- LINQ链接数据库出错(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 closed first”
- 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 closed first"错误
- error '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 closed first.
- There is already an open DataReader associated with this Connection which must be closed first
- There is already an open DataReader associated with this Connection which must be closed first
- There is already an open DataReader associated with this Connection which must be closed first
- 一例发生在cshtml页面中的There is already an open DataReader associated with this Command which must be closed