Note that there are some explanatory texts on larger screens.

plurals
  1. POI get this SQL A transport-level error, but not all the time
    text
    copied!<p>I try to query data from the database and sometimes I get this error in my log:</p> <blockquote> <p>A transport-level error has occurred when receiving results from the server. (provider: TCP Provider, error: 0 - The handle is invalid.) The code is inside a try-catch block. What is weird is that i do not get this error all the time. The catch block does get executed.</p> </blockquote> <p>However, whether i get the error or not, the Drop Down Lists i am trying to populate do not get populated. It seems like there is no data being returned from the query. </p> <p>I am making a connection to the database, the data is in there, i can open a connection and run queries to the database. The database is on the same machine as where im running the code from.</p> <p>Also, the code works when i connect to the database on the server, but i am trying to make a local database to work when i dont have connection to the server. I just have to make a change to the connection string when i want to run from the local database.</p> <p>Here is the function that queries the database</p> <pre><code>public static void QueryDB(string query) { cmd = new SqlCommand(); cmd.CommandText = query; cmd.Connection = MyConn; if (dr != null) dr.Dispose(); dr = cmd.ExecuteReader(); } </code></pre> <p>Here is the connection string to connect to the database:</p> <pre><code>MyConn = new SqlConnection("Data Source=tcp:localhost; Database=EscalationManagementSystem; Integrated Security=true;"); </code></pre> <p>Is there a setting that is wrong or could this be a bug in the code.</p> <p>Thanks in advance.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload