ADO.Net Entity framework, Fatal error encountered during data read

c# entity-framework mysql mysql-connector

Question

I am getting the following error while using MySql with Entity framework. I have set the default connection timeout to 300000 on the connection string of EntityConnectionStringBuilder. How to resolve this in 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.

Update: How can we set net_read_timeout for ado.net entity framework?

1
0
8/22/2012 2:43:56 PM

Accepted Answer

Like this

data.Database.ExecuteSqlCommand("set net_write_timeout=99999; set net_read_timeout=99999");
2
10/17/2012 7:26:14 PM

Popular Answer

what does the inner exception say?

Unhandled Exception: System.Data.EntityCommandExecutionException does not point to a timeout error, it could be something as simple as an int that needs to be nullable that is used in your EF query.

Could you give the query to?

Cheers



Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow