10

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?

0

8 Answers 8

12

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.

4

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.

1
  • 3
    I have seen this happen over VPN connections as well. Not sure if that is the case here.
    – ses011
    May 5, 2014 at 23:12
2

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!

0

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

0

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.

0

In my case it was caused by vpn (kerio) and I was able to easily bypass that using ssh tunneling (ssh -R) the database port to 127.0.0.1:[someportnumber] and connecting the app the it

0

I got this error due to SQL Server not liking one of my commented out lines of SQL. My advice is to start with the simplest code to validate that it is not a connection issue and then work up from there.

The commented out line was --EXEC master..xp_cmdshell 'bcp ... for which the remote computer did not have permission to run. There is an almost identical line later on in the code that was accepted, so I think this is some vague security patch error. You would think a commented out line would have no affect on connectivity issues, but here we are.

-4

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.