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

mac2022-06-30  27

使用MVC4 EF Linq获取foreach列表循环的时候遇到了如下的问题:报错提示 There is already an open DataReader associated with this Connection which must be closed first

解决方法如下红色所示: @foreach (var item in Model.ToList()) {   @Html.ActionLink(@item.user.nickname + "(微信)", "../Mess/MessInfo", new { id = item.id }) } 将Model改成Model.ToList()的就ok了

 

转载于:https://www.cnblogs.com/hww9011/p/3611592.html

相关资源:JAVA上百实例源码以及开源项目
最新回复(0)