首页 > 其他 > 详细

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

时间:2014-03-20 18:40:15      阅读:801      评论:0      收藏:0      [点我收藏+]
使用MVC4 EF Linq获取foreach列表循环的时候遇到了如下的问题:报错提示
There is already an open DataReader associated with this Connection which must be closed first
bubuko.com,布布扣
解决方法如下红色所示:
@foreach (var item in Model.ToList())
{
 @Html.ActionLink(@item.user.nickname + "(微信)", "../Mess/MessInfo", new { id = item.id })
}
将Model改成Model.ToList()的就ok了

本文出自 “随风飞随风停” 博客,请务必保留此出处http://hww9011.blog.51cto.com/3545422/1379744

There is already an open DataReader associated with this Connection which must be closed first,布布扣,bubuko.com

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

原文:http://hww9011.blog.51cto.com/3545422/1379744

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