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