解决"There is already an open DataReader associated with this Command which must be closed first." exception in EF 中

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

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

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

披荆斩棘,朝自己的信仰!Go on
原文地址:https://www.cnblogs.com/lyk831216/p/2296176.html