A transport-level error has occurred when sending the request to the server

Posted on

Question :

In our Vb.net application(userd within a local network connection inside a office), which is used from long time now some of the users get the errors only sometimes a day

A transport-level error has occurred when sending the request to the server. (provider: TCP Provider, error: 0 – An existing connection was forcibly closed by the remote host.

I have already checked following

  1. All databases are set to autoclose OFF

  2. Didn’t find much network problems and network speed is good.

  3. When I checked in SSMS the under server properties remote query time-out set to 600 seconds

  4. I checked sql server log and no errors found relating to it or same error message

So what may be the reason for this error? And how to troubleshoot it?

Answer :

If an application opens a connection (successfully) to SQL Server, and leaves it open in anticipation of sending a (or possible ‘another’) query, and in the meantime, SQL kills that connection for some reason (eg, service restarts, or a kill command is sent), then when the connection (which thinks it’s open) tries to send a command, you’ll get this error.

So catch the error in your application, and reconnect. Then try the command again.

I mostly see this error if for some reason the network connectivity was lost, even for a few seconds. That could be someone disconnecting a cable, an unstable wifi connection, a bad network switch, computer that goes to sleep (it’s on by default on Win7 and up), Windows update updating a network driver, etc.

I ran across the same error a while back and meant to post my answer, but I couldn’t log in and simply forgot. I happened upon this question again and will give my answer as best as I can remember as it’s quite obscure and I could find no mention of it anywhere else.

This error is returned from MS-SQL databases when passing some form of invalid date to an SP from .NET (and potentially other sources). IIRC, I was passing in a .NET MinDate (ie. default value). Basically, just check your date parameters and make sure they are sensible!

I got exactly the same error in my application. It updates many records in single transaction. I fixed this by increasing SqlCommand.CommandTimeout parameter.

In my case someone started a wireless printer with a fixed IP on the network, causing an IP conflict. After killing the printer all working fine.

in my case this error getting if your C drive space low,and every second generate new logs files.

So resolution is all logs delete in c drive then working fine again.

Leave a Reply

Your email address will not be published. Required fields are marked *