zwei1121

博客园 首页 新随笔 联系 订阅 管理

2012年3月28日 #

摘要: 【linq to sql】已有打开的与此命令相关联的 DataReader,必须首先将它关闭在Linq to SQL和Entity Framework,使用Linq查询数据的时候会出现错误:There is already an open DataReader associated with this Command which must be closed first 。解决方案: 1.在数据库连接串上添加MultipleActiveResultSets=true。 2.进行重复操作之前,将数据查询结果放入内存中,再进行使用。 阅读全文
posted @ 2012-03-28 14:18 zwei 阅读(353) 评论(0) 推荐(0) 编辑