在Linq to SQL和Entity Framework,使用Linq查询数据的时候会出现错误:There is already an open DataReader associated with this Command which must be closed first 。
解决方案:
在数据库连接串上添加MultipleActiveResultSets=true。
本文介绍了解决在使用LinqtoSQL和EntityFramework进行LINQ查询时遇到的ThereisalreadyanopenDataReaderassociatedwiththisCommandwhichmustbeclosedfirst.错误的方法。通过在数据库连接字符串中添加MultipleActiveResultSets=true来解决此问题。
开发板推荐:天空星STM32F407VET6开发板
超高性价比 STM32主控 | 超高主频 | 一板兼容百芯 | 比赛神器 | 沉金彩色丝印
在Linq to SQL和Entity Framework,使用Linq查询数据的时候会出现错误:There is already an open DataReader associated with this Command which must be closed first 。
解决方案:
在数据库连接串上添加MultipleActiveResultSets=true。
开发板推荐:天空星STM32F407VET6开发板
超高性价比 STM32主控 | 超高主频 | 一板兼容百芯 | 比赛神器 | 沉金彩色丝印
5389
6967
390
534
565
3万+

被折叠的 条评论
为什么被折叠?
