首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >ADO.Net实体框架,读取数据时遇到致命错误

ADO.Net实体框架,读取数据时遇到致命错误
EN

Stack Overflow用户
提问于 2012-08-22 22:35:46
回答 2查看 6.9K关注 0票数 0

在实体框架中使用MySql时,我遇到了以下错误。我已经在EntityConnectionStringBuilder的连接字符串上将默认连接超时设置为300000。如何在实体框架中解决这个问题?

代码语言:javascript
复制
    Unhandled Exception: System.Data.EntityCommandExecutionException: An    
    error occurred while reading from the store provider's data reader. See the  
    inner exception for details. ---> MySql.Data.MySqlClient.MySqlException: Fatal 
    error encountered during data read. ---> MySql.Data.MySqlClient.MySqlException: 
    Reading from the stream has failed. ---> System.IO.EndOfStreamException: Attempted 
    to read past the end of the stream.

更新:如何为ado.net实体框架设置net_read_timeout?

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2012-10-18 03:26:15

像这样

代码语言:javascript
复制
data.Database.ExecuteSqlCommand("set net_write_timeout=99999; set net_read_timeout=99999");
票数 2
EN

Stack Overflow用户

发布于 2012-08-22 22:43:08

内部异常说明了什么?

未处理的异常: System.Data.EntityCommandExecutionException并不指向超时错误,它可以是像在EF查询中使用的需要可为空的int一样简单的东西。

你能把问题提交给吗?

干杯

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/12075506

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档