在将 MySql 与 Entity Framework 一起使用时,我收到以下错误。我已将 EntityConnectionStringBuilder 的连接字符串的默认连接超时设置为 300000。如何在 Entity Framework 中解决这个问题?
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 Entity Framework 设置 net_read_timeout?
最佳答案
像这样
data.Database.ExecuteSqlCommand("set net_write_timeout=99999; set net_read_timeout=99999");
关于c# - ADO.Net Entity Framework ,数据读取期间遇到 fatal error ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12075506/