Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SqlException(0x80131904): "connection was recovered and rowcount in the first query is not available"

I get an exception in my ASP.NET MVC app, the error does not always happen, but when it happens, this is the error that I get when trying to read information from the database

System.Data.SqlClient.SqlException (0x80131904): The connection was recovered and rowcount in the first query is not available. Please execute another query to get a valid rowcount.

The error only occurs on the publish version

I am using a DB from Windows Azure and claims to authenticate

like image 721
Daniel Cosio Avatar asked Oct 30 '25 04:10

Daniel Cosio


1 Answers

I solved this error message with:

SET NOCOUNT ON;

before executing the query that required a subsequent @@ROWCOUNT result.

like image 125
Joel Avatar answered Oct 31 '25 18:10

Joel



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!