Question : Transport-level error / (provider: TCP Provider, error: 0 - An existing connection was forcibly closed by the remote host.)


I have posted a question previously about this pathetic error I am getting.

I question whether we have wasted the last FIVE YEARS in designing four applications I have just begun to market.  I have four clients, ALL of which get this error....some occasionally....some often.  The code below is from an error-handler routine that gets emailed to us whenever there is a program bug or any time of error.

Because ALL connections in the connection pool get trashed when this transport error occurs using NET 2.0 +, we received errors from every one of the users at this one location within five minutes.

I have seen on another site a posting that is THREE years old involving the same transport issue.  Even a Microsft MVP is involved in it, but to no avail.  No solution had been listed.  I'm sick & ##&%* tired of having to deal with something Microsoft should have resolved by now, but I'm vested in using VB.NET now.

One of the MSDN solutions was to make sure that each workstation & the server had the same SQL Client version loaded.  I have on all of them.

I have several questions all of which are related to this.
1)  Is there a fix from Microsoft
2)  Has a workaround been designed by someone else...or MS.
3)  Would changing my connection string from user name/password to Integrated Security=SSPI

I'm desperate at this point.
Sincerely, Thanks.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
More information:
Information about this problem was automatically mailed to 

Detailed technical information follows: 
---
Date and Time:         5/27/2010 4:09:26 PM
Machine Name:          BETSY
IP Address:            192.168.1.120
Current User:          MPE\Betsy

Application Domain:    IntegraPro.exe
Assembly Codebase:     file:///C:/Program Files/IntegraAMS/IntegraPro.exe
Assembly Full Name:    IntegraPRO, Version=3.1.3777.12196, Culture=neutral, PublicKeyToken=null
Assembly Version:      3.1.3777.12196
Assembly Build Date:   5/5/2010 7:46:32 AM

Exception Source:      .Net SqlClient Data Provider
Exception Type:        System.Data.SqlClient.SqlException
Exception Message:     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.)
Exception Target Site: OnError

---- Stack Trace ----
   System.Data.SqlClient.SqlConnection.OnError(exception As SqlException, breakConnection As Boolean)
       IntegraPro.exe: N 1950890
   System.Data.SqlClient.SqlInternalConnection.OnError(exception As SqlException, breakConnection As Boolean)
       IntegraPro.exe: N 4846875
   System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(stateObj As TdsParserStateObject)
       IntegraPro.exe: N 00194
   System.Data.SqlClient.TdsParserStateObject.WriteSni()
       IntegraPro.exe: N 4857590
   System.Data.SqlClient.TdsParserStateObject.WritePacket(flushMode As Byte)
       IntegraPro.exe: N 00254
   System.Data.SqlClient.TdsParserStateObject.ExecuteFlush()
       IntegraPro.exe: N 00062
   System.Data.SqlClient.TdsParser.TdsExecuteRPC(rpcArray As _SqlRPC[], timeout As Int32, inSchema As Boolean, notificationRequest As SqlNotificationRequest, stateObj As TdsParserStateObject, isCommandProc As Boolean)
       IntegraPro.exe: N 04297
   System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(cmdBehavior As CommandBehavior, runBehavior As RunBehavior, returnStream As Boolean, async As Boolean)
       IntegraPro.exe: N 00954
   System.Data.SqlClient.SqlCommand.RunExecuteReader(cmdBehavior As CommandBehavior, runBehavior As RunBehavior, returnStream As Boolean, method As String, result As DbAsyncResult)
       IntegraPro.exe: N 00162
   System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(result As DbAsyncResult, methodName As String, sendToPipe As Boolean)
       IntegraPro.exe: N 00175
   System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
       IntegraPro.exe: N 00137
   IntegraPRO.Main_ContactMgmt_EDU.WebUpdate(xNewRec As Boolean)
       IntegraPro.exe: N 05835

Answer : Transport-level error / (provider: TCP Provider, error: 0 - An existing connection was forcibly closed by the remote host.)

>>I have posted a question previously about this pathetic error I am getting.<<
To clarify I suspect you are referring to the thread here:
http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/Q_25837130.html

I re-read the thread and your accepted solution was to the member who asked you if you were using Auto-Close.  If I understood correctly you response was:
"Yes...  ALL of my databases are set that way.  It apparently defaults to TRUE in the creation process.  I have not changed any of the default options on any of my databases."
That is not only not true, but a very bad practice.  Further I do not believe I am violating any NDA by telling you that the development team tried to remove this feature due to it's "evil" nature, but were forced to leave it for backward compatibility.

I have worked with SQL Server since version 6.5, that is 14 years ago.  I have never seen this error in any application,  but then again I would never, ever consider setting the Auto-Close on.  The only time I have seen it is in SSMS and when I have lost network connectivity. As I told you in your last thread, you can prove this yourself very easily by temporarily disconnecting from the network while using SSMS.

The bottom line and at the risk of repeating myself, is that if you accept the error message at face value and you believe it is in fact a loss of network connectivity, then clearly this is not MS's responsibility.  If you believe that the cause is something else and can prove it, I will be the first to contact MS and let them know.

So which is it?
Random Solutions  
 
programming4us programming4us