An error occurred while starting a transaction on the provider connection. See the inner exception for details.


用EntityFramework循环操作数据时,报了如下错误 

An error occurred while starting a transaction on the provider connection. See the inner exception for details.
System.InvalidOperationException: 已有打开的与此 Command 相关联的 DataReader,必须首先将它关闭。

查询了资料  https://www.cnblogs.com/dongshuangjie/p/4832100.html

发现犯了个 低级错误,

千万不要在Iqueryable查询句子里面嵌套saveChange。  Iqueryable与Ilist的区别不再啰嗦。

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM