locked
Framework 2.0 changes - TCP Provider, error: 0 - An existing connection was forcibly closed by the remote host. RRS feed

  • Question

  • If you connect to a server and open a query in SQL Managment studio (2005) and looses connection and then regain the connection, when you try to run the query it gives me a "TCP Provider, error: 0 - An existing connection was forcibly closed by the remote host."
     
    This happens against both 2005 and 2000 servers.
     
    If I re-run the query it works.
     
    However, this happens in our VB.NET app as well for clients with Wireless connections.
     
    So, something has changed in Framework 2.0 regarding this, does anyone know how to tell the client to not throw this error and just try connecting the server instead which will work?
     
    • Moved by Bob BeaucheminEditor Friday, October 9, 2009 6:12 PM Moved to a more appropriate group (From:.NET Framework inside SQL Server)
    Monday, November 14, 2005 11:14 AM

Answers

All replies

  • Hi,

    The SqlClient provider does not retry operations if the underlying connection is "broken" (e.g. closed by the server or by a glitch in the network). SQL Server Management Studio retries by trying to open the connection again.

    One factor that affects this behavior is whether or not you have connection pooling enabled. Did you include "pooling=false" in your connection string?

    This behavior should not have changed from 1.1 to 2.0. Did your 1.1 application behave differently? What error did you get (if any) on 1.1?

    Pablo Castro
    Program Manager - ADO.NET Team
    Microsoft Corp.
    Tuesday, November 15, 2005 1:44 AM
  • I have not changed anything from 1.1 to 2.0.
    (its a 1.1 converted project to 2.0)

    No, I did not get any errors like this in 1.1

    I dont have Pooling=False, Neither do I want it that way (large app with tons of connections).

    as stated it happens BOTH in Sql Management Studio as well as in any VB.NET app, it happens on several diffrent companies on diffrent continents, against diffrent SQL Servers.

    VPN Clients, WIFI Clients are hit hardest (they have tiny drops in connections often)
    Tuesday, November 15, 2005 7:21 AM
  • Bumping this.

    Any resolution yet?

    Basically, I cannot run any long running queries on computers with SQL Management Studio + Framework 2.0 installed over VPN, Not even in the OLD Query Analyzer anymore(diffrent error, same meaning).

    However, on my untouched laptop, that has the old SQL Server Client Tools installed, it works fine on the same VPN connection.

    Even on LAN it happens quite frequently, I got my app on about 150 clients, they catched this error about 40 times today.

    Tuesday, November 22, 2005 10:08 PM
  • This looks really weird. I'll talk to a few other folks in the protocols team to see if I get more ideas to help you out.

    There is one bit that particularly gets my attention: the OLD query analyzer uses the old native data-access stack; the SQL Server 2005 setup, or the VS 2005 setup, do not touch any of those bits at all. So, if you're getting the same behavior from the old query analyzer, that may indicate that there was something else that changed and may be causing this glitch. Do you get failures in QA as often as you get with the other clients? What error do you get in the QA case?

    I'll reply again to this thread once I have more details or have someone do it.

    Regards,
    Pablo Castro
    Program Manager - ADO.NET Team
    Microsoft Corporation
    Wednesday, November 23, 2005 2:10 AM
  • Hi Fredrik,

    It appears that Sqlclient grabs a connection from the pool that has already been closed because of a network error and reports an error when it tries to write to the socket.  I can't understand why the 1.1 framework would be less susceptible to these network errors than the 2.0 framework.  Would you be able to take a client-side trace that captures the error and send it to me along with the server's error log?  You can email me the files at ilsung@microsoft.com.  The instructions for setting up the trace are here:  http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnadonet/html/tracingdataaccess.aspAlso, if you know of a way for us to repro this, that would be great.

    Thanks,

    Il-Sung Lee
    Program Manager, SQL Server Protocols
    Microsoft Corp.

    This posting is provided "AS IS" with no warranties, and confers no rights.
    • Proposed as answer by Papy Normand Saturday, September 22, 2012 9:23 PM
    Thursday, November 24, 2005 2:10 AM
  • I will test the tracing on my home computer which is connected over VPN.

    However, Reproducing it in 2.0 enviroment is easy.

    Open a SQL Query in SQL Management studio to a server.

    Enter a simple query, Run the query, when its completed, disable the network connection, and immediatly enable it again, re-run the query when the network is back up again and you will get the error:

    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.)


    - Fredrik
    Thursday, November 24, 2005 7:50 AM
  • The link you gave refers to Beta 1, is there a updated document for the release version of Framework 2.0?

    Thursday, December 1, 2005 8:30 PM
  • I just received this same error today in our production environment.  Had not appeared in dev, test or uat.  Our application was built in asp.net 2.0 beta 2 and later upgraded to RTM.  Besides changing pooling, any suggestions on how to prevent this?


    Friday, December 9, 2005 6:10 PM
  • If I remember correctly, the same procedure should work for RTM bits. Is it not working for you?

    Thanks,
    Pablo Castro
    Program Manager - ADO.NET Team
    Microsoft Corporation

    Tuesday, December 20, 2005 5:41 PM
  • No, I did not get the debug trace function to work, it simply dont dump any data, dont know why.

    Anyway.

    I found a setting in the SQL Configuration Manager, on TCP/IP Protocol (native) there is KeepAlive and KeepAliveInterval that I am testing a little with.

    I sat those settings to zero, eg no keepalive checking I guess, will see how that turns out.

     

     

    Sunday, December 25, 2005 7:40 PM
  • Please let everyone know how this goes. I'm having the exact same issue with my application. Thanks!
    Monday, December 26, 2005 12:58 PM
  • So far 100% success, I left my app running yesterday, and it hadnt crashed still today,  one day later. Before the change it only took about 10 minutes on my WiFi before I got a error.

     

    Question is how you can change those values for clients only have .NET framework 2.0 installed (there is no registry entry for that one pre-defined). Registry entry is only present on those clients that have SQL 2005 Client tools installed.

    I gonna look a little further with Regmon later this week and see if its just enough to create the registry entry on a "normal" client.

    Monday, December 26, 2005 6:01 PM
  • I get the same error. It even occurs between my sql server management studio and the sql instance on the network.

    The client has the release version while the sql instance is sql server 2005 beta2. Could this be the issue?

    Error connecting to SQLSERVER1\ANINSTANCE. Err: A connection was successfully established with the server, but then an error occurred during the login process. (provider: TCP Provider, error: 0 - An existing connection was forcibly closed by the remote host.)

    This is a project i converted from 1.1 to 2.0.

    The old saved 1.1 project connects without any problems.

    It really looks like a framework 2.0 issue.

     

    Tuesday, December 27, 2005 11:37 PM
  • It would be good if you could try this against a final version of SQL Server. The fact that the beta 2 server is dropping the connection during login is not that surprising, it may be due to a protocol version mismatch detected during the login handshake.

    So I wouldn't consider this and the other issue discussed in this thread to be the same thing.

    Pablo Castro
    Program Manager - ADO.NET Team
    Microsoft Corporation

    Wednesday, December 28, 2005 12:16 AM
  • I'm getting the same error but it has nothing to do with SQL Server.

     

    Basically I have a CF app that uses the following code in two methods:

     

    string url = "http://nmea.at-ore.com:5634/" + cmd;
       try
       {
        HttpWebRequest req = (HttpWebRequest) HttpWebRequest.Create(url);
        req.Method = "Get";
        req.ContentType = "text/plain";
        req.UserAgent = "iPaq6515/.NETCF" ;
        req.Accept = "*/*";
        req.ProtocolVersion = HttpVersion.Version10;

        HttpWebResponse result = (HttpWebResponse) req.GetResponse();
        Stream ReceiveStream = result.GetResponseStream();
        Encoding encode = System.Text.Encoding.GetEncoding("utf-8");
        StreamReader sr = new StreamReader( ReceiveStream, encode );

    The only thing that differs in these two calls is the content of cmd,in both cases the url + cmd works fine when I use it directly from Internet Explorer.

    In the method that produces the exception, it happens at the last line of the following code:

                            bool EndOfFile = false;
                            string line = "";
                            string[] lineValues;
                            while (!EndOfFile)
                            {
                                line = sr.ReadLine();  //An existing connection was forcibly closed by the remote host

    Any ideas?

    Will Chapman

    Sunday, January 1, 2006 9:07 AM
  • Hi,

    The error you mention is not related to the SQL Server issue that was discussed in other posts in this thread.

    The actual error message is the same because it's the error returned by Windows when a TCP connection (a socket) is closed by the other end of a communication.

    Pablo Castro
    Program Manager - ADO.NET Team
    Microsoft Corporation

    Tuesday, January 3, 2006 3:44 AM
  • I still have problem on this on 100+ clients.

    All laptops running WiFi gets this daily.

    To replicate it, yank out your network cable and plug it back in (just for a sec)

    When you try your app again, it has crashed, giving you this error.

    And that happens EVEN if you do a new dbConn.Open in your source code, so its in a lower layer (sql connection pool layer maybe) that is is happening.

    Only way to "FIX" it is to disable connection pooling, but then our app run's slow as...

    Friday, January 27, 2006 1:12 PM
  • I am getting this error.  My situation has nothing to do with wireless.

    I am connecting through a VPN to my sql server using Management Studio and a asp.net 2.0 SQL Client conection.

    I have been working in this same configuration for the last 3 months against all production stuff (.net 2.0 and sql server 2005) and did not experience this problem until today.

    Disabling connection pooling is not an option.

    Can someone give an update on the status of this issue?  Is there a resolution?  Has MS admitted that this is a problem that will be fixed in a patch?

    Monday, February 13, 2006 11:07 PM
  • Hi

    I am getting the error below when trying to connect to SQL Server 2005  instance:

    A connection was successfully established with the server, but then an error occurred during the login process. (provider: Shared Memory Provider, error: 0 - No process is on the other end of the pipe.) (Microsoft SQL Server, Error: 233)

    I was getting crashes on VS.NET 2005 and had to kill the process and restart my machine. This time I cannot connect to SQL Server 2005.  Can someone please help on this?

    Thanks

    Kavish

    Technical details attached:

     

    ===================================

    A connection was successfully established with the server, but then an error occurred during the login process. (provider: Shared Memory Provider, error: 0 - No process is on the other end of the pipe.) (.Net SqlClient Data Provider)

    ------------------------------
    For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&EvtSrc=MSSQLServer&EvtID=233&LinkId=20476

    ------------------------------
    Server Name: MAU2KTAUKOOR\SQLSERVER2005
    Error Number: 233
    Severity: 20
    State: 0


    ------------------------------
    Program Location:

       at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
       at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
       at System.Data.SqlClient.TdsParserStateObject.ThrowExceptionAndWarning()
       at System.Data.SqlClient.TdsParserStateObject.WriteSni()
       at System.Data.SqlClient.TdsParserStateObject.WritePacket(Byte flushMode)
       at System.Data.SqlClient.TdsParser.TdsLogin(SqlLogin rec)
       at System.Data.SqlClient.SqlInternalConnectionTds.Login(Int64 timerExpire, String newPassword)
       at System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance)
       at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance)
       at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection)
       at System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup)
       at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
       at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
       at System.Data.SqlClient.SqlConnection.Open()
       at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.ObjectExplorer.ValidateConnection(UIConnectionInfo ci, IServerType server)
       at Microsoft.SqlServer.Management.UI.ConnectionDlg.Connector.ConnectionThreadUser()

    Thursday, June 1, 2006 12:35 PM
  • Exactly the same problem! And I get the following two exceptions at the same time... Is there any solution?

    A connection was successfully established with the server, but then an error occurred during the pre-login handshake.  When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: TCP Provider, error: 0 - An existing connection was forcibly closed by the remote host.)

    A transport-level error has occurred when receiving results from the server. (provider: TCP Provider, error: 0 - An existing connection was forcibly closed by the remote host.)

    Thursday, August 17, 2006 2:19 AM
  • Hello all,

    I think we have the same issue. A project that in framework 1.1.4322 experiences no problems at all gives the above symptoms after migrating to framework 2.0.50727. We are using SQL Server 2000 (version 8.00.818 SP3).

    Before the migration the project was running on a windows2000 server, and after the migration it's running on a windows2003. Don't know if that is the issue. The database server has been windows2000 all the time. The project connects through a simple LAN connection to the database server, no VPN or WiFi or anything like that.

    Thanks for any help or an update on this issue.

     

     

    best regards

     

    Per

    Tuesday, September 12, 2006 3:23 PM
  • Was this ever resolved? I am experiencing the same problem, but I don't see a resolution here. I have been able to get the problem to go away with setting Pooling to false.

    Chris
    Thursday, September 14, 2006 3:13 PM
  • I may not know a lot about SQL Server, but it seems like setting Pooling to false would decrease performance in a big way. I'm seeing this transport level error as well. It's frustratingly intermittent. My best response so far is to just "ping" the database by executing a scalar query before I attempt any updates/reads. Wash rinse repeat on the ping until the connection is available.

    I also tried setting min pools to 1 on my db connection. Will see if that helps. 

    Monday, October 16, 2006 6:11 PM
  • Well I'm getting this same error

    I'm using ASP.NET 2.0 on SQL server 2000. I uploaded some files which caused the application to restart and this what happened:

    Server Error in '/' Application.

    A connection was successfully established with the server, but then an error occurred during the login process. (provider: TCP Provider, error: 0 - The specified network name is no longer available.)

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.Data.SqlClient.SqlException: A connection was successfully established with the server, but then an error occurred during the login process. (provider: TCP Provider, error: 0 - The specified network name is no longer available.)

    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

    Stack Trace:

    [SqlException (0x80131904): A connection was successfully established with the server, but then an error occurred during the login process. (provider: TCP Provider, error: 0 - The specified network name is no longer available.)]
       System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +437
       System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +82
       System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +105
       System.Data.SqlClient.SqlConnection.Open() +111
       Microsoft.Practices.EnterpriseLibrary.Data.Database.OpenConnection() +196
    

    I'm using connection pooling. My best guess is that ADO.NET is trying to get a connection that is virtually available in the pool but is actually dead because the application has recycled and all object refrences are destined for disposal.

    Something is wrong with the connection pool and GC (releasing references).

    Thursday, November 2, 2006 7:51 AM
  • I am also getting this error when trying to comm.ExecuteReader in my custom Role Provider.

    "TCP Provider, error: 0 - An existing connection was forcibly closed by the remote host."

    Has anyone found a solution without turning off connection pooling?

    Thanks

    Stephen

    Tuesday, November 7, 2006 10:48 AM
  • I have the same problem while connecting from SQL Mgmt. Studio. Please help - Pablo. I did not see any resolutions to this issue.
    Wednesday, November 8, 2006 5:24 PM
  • So, this is the one year anniversary of this thread on a MSFT hosted message board.

    I just ran into this issue as well, using ThreadPooling to post data to SQL Server 2005.

    I use 5 threads, and attempt to reconnect on the error: An existing connection was forcibly closed by the remote host

    This works for awhile, however I eventuall get the error: The specified network name is no longer available.

    Does this mean that the TCP/IP stack is hosed?

    Could someone at MSFT please explain how to work around this, or provide a fix?

    Dag

    Thursday, November 16, 2006 7:15 PM
  • I am having the same issue. It occured today after I installed updates from Microsoft. Please advise on any fixes and thank you in advance.

    r,

    Clem

    Friday, November 17, 2006 9:30 PM
  • My bet is that they wont...

    I got tired, so I went through the procedure to submit it as a bug.
    They answered "avoidingly", that there is no work-around except turn off connection pooling, which in my case would result in about 80% performance hit or more..

     

     

    Friday, November 17, 2006 9:48 PM
  • My bet is that they wont..

     

    I submitted this as a bug, and they responded "avoidingly" that the only workaround is to turn off the connection pooling, which would result in about 80% performance hit in my application..

    Friday, November 17, 2006 9:51 PM
  • Thanks. I found a work around. I changed the logon to Network  in SQL Server Configeration Mngr instead of local and it has worked so far.

    r,

    Clem

    Thursday, November 23, 2006 3:01 AM
  • I get the same error even with Pooling=false in the connection string.

    This is crazy!

    Wednesday, November 29, 2006 4:48 AM
  • Did this work for everyone?  Changing the logon to Network?  I'm not sure why this would work but if it does I'll give it a shot.  I'm receiving the same error using .NET 1.1 connecting to SQL 2005.  The problem is very sporadic though, works about 90%, errors the other %10.
    Friday, December 1, 2006 4:08 PM
  • Has there been a resolution for this issue?  I'm having the same problem.  Please help!
    Monday, December 18, 2006 3:33 PM
  • Hi,

    I was wondering if you have a resolution for this.  Also could it be producing the general network error as well?  If you change the keepalive setting to 0 what actually happens?  Please let me know.  Thanks!

    Monday, December 18, 2006 4:15 PM
  • I got this error so many times, but not any more.

    I made sure I point to the right mailserver in Web.config.

    <system.net>

    <mailSettings>

    <smtp from="">

    <network defaultCredentials="true" host="localhost" password="" userName=""/>

    </smtp>

    </mailSettings>

    </system.net>

    If you are deploying the application to production only, then change the smtp mail server to whatever it is, or you'll get that error.

     

    Thanks,

     

    Monday, December 18, 2006 5:23 PM
  • Hi,

    Did this workaround of changing the SQL Server service's Log On As from LocalSystem to a Network user work? 

    We are having the same problem happening intermittently:

    TCP Provider, error: 0 - An existing connection was forcibly closed by the remote host.

    This error sometimes differ then into one of the following as well:

    "System.Data.SqlClient.SqlException: A transport-level error has occurred when receiving results from the server. (provider: TCP Provider, error: 0 - The specified network name is no longer available.)"

    "System.Data.SqlClient.SqlException: An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server"

     

    This is driving us crazy.  We have been running a continuous ping from the Application Server to the SQL Server (both Windows Server 2003 sitting on the same LAN) which writes a date & timestamp to a file followed by 50 pings (to try and determine when the connection between the two servers were lost).  The results looking at the last two months’ errors seems to show that at similar times to when the connection between the servers was lost, a minute or two later the SQL errors appeared.

    I can also simulate the first error by opening a query in SQL Management Studio (pointing to a SQL server somewhere on our LAN), run the query - which then returns the results as expected; then drop my network connection and reconnect to the network and rerun the same query (i.e. I did not close the query during the process of dropping my network connection and reconnecting again.

    Unfortunately we moved forward from both framework 1.14 and SQL 2000 to framework 2 & SQL 2005 at the same time - so I can say which of the two causes the problem or if it is a combination of both.  Our Web application written in C# utilises Typed Data Sets (XSD) to manage the SQL connections. 

    We have changed the connection POOLING=FALSE for the sake of seeing if that works.  It makes it better in that it happens less, but is still happens.

    Then we have also tried fiddling around with whether the service should use both TCP and Named Pipes protocols, or only TCP, etc - still only helping somewhat but not resolving the problem.

    Then we have also tried setting the KeepAlive and KeepAliveInterval to 0, which also helps a bit in making it happen less, but still does not resolve it.

    Next I am now going to try changing the Log On to network as suggested “Clemmie”, to see if that helps.  I really hope so.

    The last and final step if that does not work is that we are going to move our application onto the database server to ensure that there are no network between the app and the database.  You can just imagine how happy we are with the prospect of having to degrade to that. 

    But the point being that all of the above mentioned things are all workarounds which we all have to try make up and live with instead of fixing the problem, and nowhere can I find that MS is going to FIX THIS PROBLEM!!!

     

    Thursday, January 4, 2007 10:12 AM
  • Hi,

     

    This workaround of changing the SQL Server service's "Log On As" from LocalSystem to a Network user did not resolve the issue.

    It also helps, and the error is occurring much less than before, but the point is that it still occurs.

    Any other ideas will be appreciated.

    Regards,

    Friday, January 19, 2007 9:29 AM
  • We just started having the same problem. The app works great most of the time, but when the connection isn't stable it occurs regularly.

    Could someone at Microsoft give us an update on the status and/or any other suggested workarounds like catching the error in the application?

     

    Mike

    Tuesday, January 30, 2007 10:47 PM
  • Hi..

    I got a very similar problem regarding connection pooling of SQL server..

    I developt a web application with tons of connection. i realized that i have a connection leak somewhere due to my inexperience in working with asp.net. So I use a workaround that kill all sleeping connection except itself when logout.

    The problem is when the user try to login directly after logout. The server seems to take connection from the pool that already killed.

    The first time I get error, but the second time everithing works fine. So i use a workaroud with something like this

     

    If con1.State = ConnectionState.Open Then con1.Close()

    Connect(con1)

    con1.Open()

    SqlCommand = New SqlCommand(qry, con1)

    Try

    ExecQry = SqlCommand.ExecuteReader()

    Catch

    If con1.State = ConnectionState.Open Then con1.Close()

    Connect(con1)

    con1.Open()

    SqlCommand = New SqlCommand(qry, con1)

    ExecQry = SqlCommand.ExecuteReader()

    End Try

     

    This might be risky if for some reason it pooling a dead connection for the second time, so i also use a default error message in my web.config

     

    Friday, March 9, 2007 5:03 AM
  • Hi,

    I get the same type of error and right now have no idea haow to fix it. It works fine from my development computer, but I get this error from my live server IIS6.0

    Server Error in '/chat_test2' Application.
    --------------------------------------------------------------------------------

    An error has occurred while establishing a connection to the server.  When connecting to SQL Server

    2005, this failure may be caused by the fact that under the default settings SQL Server does not allow

    remote connections. (provider: TCP Provider, error: 0 - No connection could be made because the target

    machine actively refused it.)
    Description: An unhandled exception occurred during the execution of the current web request. Please

    review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.Data.SqlClient.SqlException: An error has occurred while establishing a connection to the server.  When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: TCP Provider, error: 0 - No connection could be made because the target machine actively refused it.)

    Source Error:


    Line 110:            'to the global.asax file, which will use the default error
    Line 111:            'handling page to process/display the custom error to the user
    Line 112:            Throw
    Line 113:        End Try
    Line 114:    End Function
     

    Source File: D:\Webservices_test\chat_test2\App_Code\Dal\ChatRoomDB.vb    Line: 112

    Stack Trace:


    [SqlException (0x80131904): An error has occurred while establishing a connection to the server.  When

    connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL

    Server does not allow remote connections. (provider: TCP Provider, error: 0 - No connection could be

    made because the target machine actively refused it.)]
       System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean

    breakConnection) +734771
       System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +188
       System.Data.SqlClient.TdsParser.Connect(Boolean& useFailoverPartner, Boolean&

    failoverDemandDone, String host, String failoverPartner, String protocol, SqlInternalConnectionTds

    connHandler, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity,

    SqlConnection owningObject, Boolean aliasLookup) +820
       System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject,

    SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +628
       System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity,

    SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection

    owningObject, Boolean redirectedUserInstance) +170
       System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object

    poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +359
       System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection

    owningConnection, DbConnectionPool pool, DbConnectionOptions options) +28
       System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +424
       System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +66
       System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +496
       System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)

    +82
       System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection,

    DbConnectionFactory connectionFactory) +105
       System.Data.SqlClient.SqlConnection.Open() +111
       System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32

    startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)

    +121
       System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords,

    String srcTable, IDbCommand command, CommandBehavior behavior) +137
       System.Data.Common.DbDataAdapter.Fill(DataSet dataSet) +86
       ChatRoomDB.GetChatRoomList() in

    D:\Webservices_test\chat_test2\App_Code\Dal\ChatRoomDB.vb:112
       ChatRoom.GetChatRoomList() in D:\Webservices_test\chat_test2\App_Code\Bll\ChatRoom.vb:59
       ContentFiles_Default.Page_Load(Object sender, EventArgs e) in

    D:\Webservices_test\chat_test2\ContentFiles\Default.aspx.vb:32
       System.Web.UI.Control.OnLoad(EventArgs e) +99
       System.Web.UI.Control.LoadRecursive() +47
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean

    includeStagesAfterAsyncPoint) +1061

     


    --------------------------------------------------------------------------------
    Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET

    Version:2.0.50727.42
    Sunday, April 8, 2007 4:58 PM
  • Bumping this. We experience exactly the same problem on a 2 tiered web/db system. When performing a sql trace/profile all looks fine, but reefering to perfmon SQL general statistics, we notice that there are a large amount of logins but no logouts. A test system on a older asp.net version and a single machine configuration with the same versions does not experience this problem. Disabling pooling is not an option. Any advice?
    Friday, May 18, 2007 1:43 PM
  • Hey Microsoft!

     

    As an earlier poster asked, when can we expect a response on this issue? Or is this just something we need to upgrade to get fixed?

    Sunday, May 20, 2007 5:27 AM
  • We've been having this problem for a few months now. Will MS please comment on this issue?

     

     

    Friday, May 25, 2007 4:03 PM
  •  J. Ekbom wrote:
    Bumping this. We experience exactly the same problem on a 2 tiered web/db system. When performing a sql trace/profile all looks fine, but reefering to perfmon SQL general statistics, we notice that there are a large amount of logins but no logouts. A test system on a older asp.net version and a single machine configuration with the same versions does not experience this problem. Disabling pooling is not an option. Any advice?


    Update!

    Our problem with this issue originated from the use of CLR (Common Language Runtime) in some functions and stored procedures and vanished when replaced with ordinary T-SQL queries. We even experienced a significant performance increase. Might not work for all, but it's probably worth a try.

    Interesting article on the subject "Choosing Between CLR & T-SQL in SQL Server 2005" from DevX.com.

    Best Regards
    Johan Ekbom


    Tuesday, May 29, 2007 1:24 PM
  •  

    When testing scalability with a large number of client connection attempts to an instance of the SQL Server Database Engine running on Windows Server 2003 Service Pack 1, Windows may drop connections if the requests arrive faster than SQL Server can service them. This is a security feature of Windows Server 2003 Service Pack 1, which implements a finite queue for incoming TCP connection requests. It results in the following error:

    ProviderNum: 7, Error: 10054, ErrorMessage: "TCP Provider: An existing connection was forcibly closed by the remote host ...

    To resolve this issue, use the regedit.exe utility to add the following registry key:

    Key Type Name Value

    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\

    DWORD

    SynAttackProtect

    00000000

    Wednesday, July 25, 2007 3:27 PM
  • (I'm not from MS, but this might help)

     

    I am building an application that will be run on a laptop.  This application expects that sometimes it will be plugged into the network, and sometimes not.  When a network connection is available ( Microsoft.VisualBasic.Network.IsAvailable  ), data is stored directly to SQL Server.  When the network is unavailable, data is stored in an MS Access DB on the laptop.  Then when the network connection is available again, the user has the option to transfer any data stored in the MS Access DB to SQL Server.

     

    My initial build and testing of this application was done using SQL Server Express edition installed locally on the machine.  Once I copied my database up to SQL Server on a server and tried to test the application, I ran into this same error being discussed.

     

    In my case, the solution was to execute the code:

    SqlClient.SqlConnection.ClearAllPools()

    at the time my program first discovers the network is not connected ( the connection test for my application is done using a Timer ).

     

    For anyone struggling with this problem, you could Catch the SqlException and if the SqlException.Number = 10054, simply retry the command that threw the exception.

    Thursday, August 2, 2007 1:26 PM
  •  

    Hi Sung ,

     

    You can follow the method provided in the following link to generate the error.

    http://www.ondotnet.com/pub/a/dotnet/2004/02/09/connpool.html?page=last&x-maxdepth=0

     

    Regards,

    Ankur

    Monday, August 13, 2007 5:32 AM
  •  

    I am a single Mother-divorced- I DO NOT APPRECIATE EVERY DAY- getting these Framework 1:1 update's- that does not apply to me !!!!        PLEASE STOP !!!!!!
    Tuesday, August 14, 2007 2:42 AM
  • Hello everyone, I am also getting the same problem and it seems like this thread has the most people with similar situations.  We are running an asp.net 2.0 app on IIS5 with SQL Server 2000.  Our sql connection string uses TCP/IP - our web and sql server are on separate machines.

    Everything was working fine until today when we suddenly get the error message:

    "An error has occurred while establishing a connection to the server.  When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: TCP Provider, error: 0 - No connection could be made because the target machine actively refused it.)"

    We've tried restarting all our servers, testing on different machines, all to no avail.  In addition we cannot connect to the sql server remotely using Enterprise Manager either.  All other apps (some non-web) we use that connect to the same sql server also suddenly do not work.

    Please note that our sql server already allows remote connections, etc., and everything was working completely fine yesterday and has been for the past few months.  No code or settings have been changed in between yesterday or today.  Can anyone from MS please provide some input into this problem?  Looks like others have been having this same problem since 2 *years* ago and there is still no solution!  I've scoured the Internet and haven't found anything useful.  Please help!
    Friday, September 7, 2007 10:09 AM
  •  

    Bumping the T. We have the exact same problem here.

     

    We have an open call in to Microsoft about the issue and we're going to refer them to this thread.

     

    I'll post back if we find a resolution.

    Monday, September 17, 2007 6:34 PM
  • There was mention of the Denial of Service defenses in SQL Server 2005 above, as described in this MSDN2 page (Error 10054):

     

    http://msdn2.microsoft.com/en-us/library/ms189083.aspx

     

    A similar but different error message with a different cause is listed in this msdn blog (error: 0):

     

    http://blogs.msdn.com/sql_protocols/archive/2005/09/28/474698.aspx

    • A successful TCP connection from SqlClient to the server was broken due to a TCP keep-alive heartbeat failure (typically indicating problems with the underlying network infrastructure):

    A transport-level error has occurred when receiving results from the server. (provider: TCP Provider, error: 0 - The specified network name is no longer available.)

    Possibly:

    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.)

    Wednesday, November 21, 2007 1:17 AM
  • Hi,

     

    Same problem, No solution.

     

    Any news?

     

    Regards

     

    Thursday, January 3, 2008 12:47 PM
  • Hi,guys! Finallllly, I found the workaround!!!!!! Excuse me, I am so happy.

     

     

    Example in a SQL SERVER 2005 server.

    Just see the Property of the Server and on the property page, change to the Advance menu, there is a property "Remote login Timeout value" there!  By default, the value is 20 second. If your connection's life is over 20 second, it will be killed. So the report "An existing connection was forcibly closed by the remote host" jumping out of the box!

     

    I just change it to 500second, and the problem is gone!

     

    I know the connection killing system is still there, but most of us only want to know how to aviod it.

    That's all.

     

    Ivan

     

    Monday, January 21, 2008 8:12 AM

  • I've tried ivanchain's suggestion and it does not fix the problem. It does reduce the problem but is does not eliminate it. I even tried disabling "Remote Login Timeout" by setting it to 0 but still got the transport level error occasionally.

    We are running multiple .Net web sites using "Application Center 2000" and IIS 6 on two virtual servers. The SQL server is MS SQL 2005 Service Pack 2 running on another virtual server.

    The only way I've been able to stop this problem is by disabling connection pooling (Pooling=false; ) altogether. You'll also need to change some registry entries when you disable connection pooling. Look at the following link for the registry settings:

    http://support.microsoft.com/default.aspx?scid=kb;en-us;328476





    Monday, February 4, 2008 3:32 PM
  •  

    hi,  DC Charge

     

    but is too slow to close the pooling, it's not  a good workaround.

     

    ivan

    Monday, February 4, 2008 4:07 PM
  • This is untested, but it looks like the solution to intermittent connection problems.

    This article describes one part of the solution - change the TCP-IP settings so that the TCP-IP provider will detect broken connections before you attempt to use them with the SQLCommand object:

    http://www.informit.com/articles/article.aspx?p=371702&seqNum=1

    The second part of the solution is add a try catch sequence so that you retry the command execution when you catch the connection error.

    It goes something like this:

    for attempt = 1 to 3
    try
    connection.open()
    command.executenonquery()
    exit for
    catch e as sqlexception
    if (e.message.contains("TCP Provider, error: 0")) then
    '  Mark all connections in the connection pool as doomed so they won't be reused...
    '  because the other connections are likely also broken if one of the connections is broken.
    SqlClient.SqlConnection.ClearAllPools()
    end if
    finally
    connection.close()
    end try
    next attempt



    Wednesday, February 6, 2008 9:46 PM
  • Wow, that's not much of a workaround. That'll have a cascading effect, similar to a stack overflow. IF you manage to get a stable connection, 1 out of 3 times, those dead connections will remain in future connection attempts. Eventually more and more connections will timeout and your loop will eventually fail 3 times out of 3. The SQL server will probably need a restart and your application will get progressively slower until it just plain errors.


    The connection pool problem needs to garbage collect closed connections from the pool, free up the resources and NEVER forcibly close a connection from a pool and offer it for reuse.
    Friday, February 8, 2008 3:03 PM
  • I found the source of our apparent nightly connection/network problem after a few days of research, retrieving the SQL Server logs, and cross-checking the windows event logs with data gathered on low memory conditions on the operating system.  The problem was happening after the first attempt to execute a command, sometimes after a given time of day, but on a daily basis.  This is because opening a pooled connection doesn't open it because a pooled connection remains open and gets put back in the pool after it is "closed".  The connection failure is detected when you attempt to use the connection by executing a SQL command object.  Some of the underlying mechanics and logic behind .NET 2.0 connection pooling is explained here:

    http://blogs.msdn.com/angelsb/archive/2004/10/05/238153.aspx

    The real error was happening on the SQL Server machine and was logged in the SQL Sever event logs, but wasn't returned the same way to the failed connections because the connections were broken at the same time the errors occurred.

    In our SQL Server Log, there was evidence of a reaction to a shortage of physical memory that is seen in SQL Server Standard edition, and in some cases on SQL Server Enterprise edition, when AWE is not enabled.  We were experiencing a Hard Trim, when the operating system pages SQL Server memory to disk - then SQL Server is forced to recycle some of it's processes due to a shortage of memory that SQL Server needs to run its processes.  (AWE locks the memory pages and that prevents the operating system from paging them to disk).  This causes the connections to the database to be broken at the server, and the following messages to be returned to the client:

    A transport-level error has occurred when receiving results from the server. (provider: TCP Provider, error: 0 - The specified network name is no longer available.)


    or:


    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.)


    http://blogs.msdn.com/slavao/archive/2005/04/29/413425.aspx

    http://blogs.msdn.com/psssql/archive/2007/05/31/the-sql-server-working-set-message.aspx

    Error in the SQL Server event log:

    A significant part of sql server process memory has been paged out. This may result in a performance degradation. Duration: 0 seconds. Working set (KB): 24484, committed (KB): 48036, memory utilization: 0%

    The solution for our situation is to rebuild the SQL Server on Windows 2003 Enterprise edition, with SQL Server Enterprise edition, so that AWE can be enabled to prevent the operating system from paging the phisical memory, allocated to SQL Server processes, to disk.
    Wednesday, February 20, 2008 9:31 PM
  • I have very similar problem. Running off virtual machine I'm trying to establish connection on the local loop. My code is very simple, yet it yelds an exception:
    A connection was successfully established with the server, but then an error occurred during the login process.
    (provider: TCP Provider, error: 0 - An existing connection was forcibly closed by the remote host.)


    Code Snippet

    RTDBConnection = new SqlConnection();

    RTDBConnection.ConnectionString = "Data Source=tcp:(local),1707;Trusted_Connection=yes;WSID=localhost;Database=esrealtime;";



    Any ideas ???



    Tuesday, March 11, 2008 3:37 PM
  • We're getting this error on SQL2005 SP2 / W2K3R2 talking to an app on IIS6 .NET2 SP1

     

    We have been running our app for about 2 years with IIS6 on a physical server and SQL2005 on ESX 2.5 VM. We have recently moved this over the IIS and SQL running on ESX3i VM, but each on it's own physical server (running via the virtual switch then over a GB physical network). This is when the problem started happening for us.

     

    I'm seeing many people mention Virtual Machines. Could this be the cause? Something to do with the virtual switches dropping packets?

     

    Is anyone having this issue running over physical servers and hard weird network only?

     

    Sunday, March 16, 2008 2:32 AM
  • Not MS, but we fixed it by starting the .netRuntimeOptimization service on the remote host.

     

    http://www.codeprof.com/dev-archive/41/19-95-417243.shtm

     

    Monday, April 14, 2008 5:19 PM
  • Could this possibly be the cause of these errors:

     

    http://support.microsoft.com/kb/942861

     

    We have started seeing these intermittent errors about an existing connection being closed and we are running servers with the Broadcom NetXtreme II network cards.  The SQL server, running Windows Server 2003 R2 SP2 x64 Enterprise doesn't have the chimney settings activated in the registry but all of our other servers, running Windows 2003 R2 SP2 x86 Standard, that connect to the SQL server do.

     

    I'm off to look for updated BIOS and firmware to see if any of these have been resolved, if not then it'll be a case of testing with this TCP Chimney Offload turned off.

     

    EDIT: Note that these servers do not have .Net Framework 2.0 installed (still being offered in Windows Update and not in Add/Remove programs) so might not be related to this discussion but just thought I'd post in case it helps.

    • Proposed as answer by M. AMIR Tuesday, March 30, 2010 8:23 AM
    Tuesday, April 22, 2008 11:00 AM
  • the same happens on SQL Server 2005 with SP2.
    It's now 3 years later, when will you solve this problem???

    Wednesday, June 25, 2008 6:35 PM
  •  

    I should have followed this up ages ago but here is our experience.  As per the knowledgebase article I linked to:

     

    This problem occurs because the TCP Chimney Offload feature is enabled on the server. The TCP Chimney Offload feature is enabled by the Windows Server 2003 Scalable Networking Pack.

     

    This article also mentions that the TCP Chimney Offload feature is also enabled by installing SP2 for Windows 2003.  In our case these errors stoppped as soon as we disabled this feature on the client machines.  I'm not sure if it is neccessary to also do this on the SQL server as it was already disabled for us.

     

    Hope this helps.

    Thursday, June 26, 2008 7:51 AM
  • We just migrated to new servers and our message board and chatroom are slowing down periodically,

    bumping people off the website, or sending errors  like this:

    ==========Server Error============== Could not connect to the <>DB server. Error Number:-2147467259 Description: Timeout expired

     

    Sometimes the site works great and fast. If we have over 250 online, members get booted out of chat,

    pages can take up to a minute to load.

     

    We never had this problem before we moved to the new servers last week.

     

     

    Tuesday, July 8, 2008 2:56 PM
  •  

    Disabling TCP Chimney solved our problem. Our problem popped up with the latest windows updates. Something in there caused this to occur. We are not sure yet which update triggered the issue. We run Server 2003 x64 SP2 with a .net 2.0 app connecting to a SQL 2005 SP2 DB.
    Thursday, July 17, 2008 5:22 PM
  • Hello all !

     

    We do not use  TCP Chimney, but still we get the following error in a ASP.NET application running on a Windows 2003 server 32x SP2 with SQL-Server 2008 SP1. The SQL-Server and the IIS are both on the same server. I really do not understand why we get this error :

     

    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.)

     

     On a previous 2003 server with dedicated sql-server 2005 this problem did not appear.

     

    Thanks a lot for any hint on how to get this fixed !

     

    Regards,

    Fabianus

    Tuesday, September 23, 2008 6:07 PM
  • I think you might be surprised, if you have Windows Server 2003 SP2 installed then this service pack turns on the feature as it also installs the Windows Server 2003 Network Pack as per the details in the KB article I provided.  If you haven't already then please do follow the advice given in that KB article as it solved the problem for us.

     

    I'm sure I read recently about a hotfix that resolves the issues associated with TCP Chimney but to be honest given our experience I'd just turn it off.  Are you saying you have actioned the advice in that KB article?

    Wednesday, September 24, 2008 9:00 AM
  • Dear Pablo,

    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 dotnet application and using sql server 2000  for database.

    This application installed at client server is working fine since last release, but from last 2 days all users, logged in to appliction, receive above mention error message. I am not able to find out the actual root of the error.

    I am feeling that code dont have any problem, since same application running fine before this error message and we don' t

    do any change there.

    If you required any more information please let me know about that.

     

    Thanks in advance for the your feedback and help..

    I am wating for reply...

     

    Thanks and regard,

    Bunty

    Monday, November 10, 2008 7:23 AM
  • I experienced this issue when moving code from .NET 1.0/1.1 to .NET 2.0.

     

    It came down to a new parameter setting in .NET 2.0 Remoting.

     

    This two statements needed changing from:

     

    RemotingConfiguration.Configure( configFile, true );

    ChannelServices.RegisterChannel( tcpChannel, true );

     

    To:

     

    RemotingConfiguration.Configure( configFile, false );

    ChannelServices.RegisterChannel( tcpChannel, false );

     

     

    Wednesday, November 19, 2008 9:00 PM
  •  Framework 1:1 net wrote:

     

    I am a single Mother-divorced- I DO NOT APPRECIATE EVERY DAY- getting these Framework 1:1 update's- that does not apply to me !!!!        PLEASE STOP !!!!!!

    Telstra's Hyperconnect service is not setup correctly at Elenora. Could you please investigate this issue?

    Thanks!
    Thursday, December 4, 2008 4:52 AM
  • I had the following issue:

     "A transport-level error has occurred when sending the request to the server. (provider: Named Pipes Provider, error: 0 - The specified network name is no longer available"

    This occured on a Server 2008 machine running SQL 2008 connecting remotely to a Server 2003 box running SQL 2000.  I was using SQL Server Management Studio to connect to the SQL 2000 machine using a standard Microsoft VPN connection.

    After reading this long thread and trying a few things that didn't work I finally found a solution by making sure a mapped drive to the same machine was connected and stays connected.  I'm sure this serves as a "heartbeat" of sorts that keeps the connection alive.

    I know this won't help you guys that have application problems directly but some of the problems here did appear similar to mine.

    Good luck
    Thursday, January 22, 2009 2:44 PM
  • Here's my scenario:

    WCF Service error:

    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.)

    SQL Server 2008 event log error:

    The server will drop the connection, because the client driver has sent multiple requests while the session is in single-user mode. This error occurs when a client sends a request to reset the connection while there are batches still running in the session, or when the client sends a request while the session is resetting a connection. Please contact the client driver vendor.

    I encountered this error when our WCF service was set to single-instancing but allowing multiple threads.  The service was using ADO.NET and ADO.NET is not threadsafe so when it was set to single-threaded the error went away.

     Chad

    Tuesday, February 10, 2009 9:00 PM
  • Looks like this thread has been ongoing for over 3 years now.  So I assume it's safe to say that Microsoft are NOT looking into this error and no one has found a consistant reliable solution?

    Add my vote to this problem, .NET 3.5 against a SQL 2000.

    Tuesday, March 10, 2009 7:54 PM
  • We are running into this same problem, I tried quite a few things most listed in this thread. None really worked though. We finally tried replacing the switches that the SQL server was on. This lowered the amount greatly but we are still getting them 2 years later, ARG!
    Friday, April 17, 2009 7:30 PM
  • Same problem here with SQL Server 2005 Enterprise 64-bits on Windows 2003 SP1 64-bits.  Users are having the errors below from the Sharepoint web server. Found the link on Microsoft  http://msdn.microsoft.com/en-us/library/ms187005.aspx.  Working to resolve this problem and will post more if problem is resolved.  Meanwhile, would appreciate it if anyone has resolve this problem before and post your solutions.


    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.Data.SqlClient.SqlException: 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.)

    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

    Stack Trace:

    [SqlException (0x80131904): 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.)]
       Microsoft.SharePoint.Library.SPRequestInternalClass.GetListItemDataWithCallback(String bstrUrl, String bstrListName, String bstrViewName, String bstrViewXml, SAFEARRAYFLAGS fSafeArrayFlags, ISP2DSafeArrayWriter pSACallback, ISPDataCallback pPagingCallback, ISPDataCallback pSchemaCallback) +0
       Microsoft.SharePoint.Library.SPRequest.GetListItemDataWithCallback(String bstrUrl, String bstrListName, String bstrViewName, String bstrViewXml, SAFEARRAYFLAGS fSafeArrayFlags, ISP2DSafeArrayWriter pSACallback, ISPDataCallback pPagingCallback, ISPDataCallback pSchemaCallback) +132
       Microsoft.SharePoint.SPListItemCollection.EnsureListItemsData() +1525
       Microsoft.SharePoint.SPListItemCollection.get_Count() +48
       Microsoft.SharePoint.SPList.GetItemById(Int32 id, String strRootFolder, Boolean cacheRowsetAndId) +407
       Microsoft.SharePoint.SPContext.get_Item() +851
       Microsoft.SharePoint.SPContext.get_ListItem() +31
       Microsoft.SharePoint.Publishing.WebControls.ConsoleUtilities.get_ContextualListItem() +69
       Microsoft.SharePoint.Publishing.WebControls.AuthoringContainer.OnPreRender(EventArgs e) +795
       System.Web.UI.Control.PreRenderRecursiveInternal() +80
       System.Web.UI.Control.PreRenderRecursiveInternal() +171
       System.Web.UI.Control.PreRenderRecursiveInternal() +171
       System.Web.UI.Control.PreRenderRecursiveInternal() +171
       System.Web.UI.Control.PreRenderRecursiveInternal() +171
       System.Web.UI.Control.PreRenderRecursiveInternal() +171
       System.Web.UI.Control.PreRenderRecursiveInternal() +171
       System.Web.UI.Control.PreRenderRecursiveInternal() +171
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +842
    


    Version Information: Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET Version:2.0.50727.3053

    Server Error in '/' Application.

    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.)

     

     

    Friday, June 5, 2009 10:03 PM
  • More on this problem. My fix in January helped but actually didn't resolve the problem however I believe that I have gotten by my version of the issue and it was related in a sense to the mapped drive work around.

    As it turns out I had an old Server 2003 development machine that had a flawless VPN connection to the production server 2003 machine.  After careful comparison of the VPN settings between the 2003 machine and the 2008 machine adding support for "Client for Microsoft Networks" has after 24 hours completely solved the issue.

    My guess is that in 2003 this setting is defaulted on while Server 2008 it is turned off by default as a big product goal of 2008/Vista is a more secure environment.  This means items are off by default.

    At any rate this problem seems to have many faces as this thread illustrates but I would examine the network settings in extreme detail.  Change one configuration at a time to see if the problem is resolved.


    Thursday, June 11, 2009 4:07 AM
  • Has anyone tried converting their projects with this issue to use the .net framework 3.5 rather than 2 ? I have a project doing the exact same thing and none of the SQL Server advised changes are solving the issue. As the issue seems to be linked to framework 2 it would seem that this might solve
    the issue but I'm keen to know if anyone has tried that before we go through with it.
    Wednesday, July 1, 2009 10:16 AM
  • Still problem with framework 3.5 and sql server 2008 standard edition. Remote query timeout is set to 600 but we still get this error from time to time.
    HN
    Wednesday, July 1, 2009 2:53 PM
  • Update to our problem.  The error message is very misleading.  It has nothing to do with SQL Server.  It is the host servers are having big memory leaks that caused the guest sharepoint servers' connectivity problem. oouch!!!  so, a regular scheduled reboot is necessary and still looking for the sources of the memory leaks.
    Wednesday, July 1, 2009 10:56 PM
  • The SQL server, running Windows Server 2003 R2 SP2 x64 Enterprise doesn't have the chimney settings activated in the registry but all of our other servers, running Windows 2003 R2 SP2 x86 Standard, that connect to the SQL server do.

    Hi Jason,

    Can you elaborate where we can find the chimney setting?

    Thanks in advance.

    Jemmy Sentonius
    Tuesday, July 7, 2009 7:55 AM
  • I don't think Microsoft knows how to fix these error. From SQL Server 2000, 2005 and now 2008, still having this error without the solution? I believe this thread can go for few more years.

    I do encounter the same error on Server 2003 with SQL Server 2005?

    Very, very, very frustrating.
    Monday, July 13, 2009 10:20 AM
  • hey i have the same problem, i have a sql managment express server 2005 and we have a lot of remote terminals, i have this problem with the pcs who are out of the same network segment,

    Msg 10054, Level 20, State 0, Line 0

    A transport-level error has occurred when receiving results from the server. (provider: TCP Provider, error: 0 - An existing connection was forcibly closed by the remote host.)

    if we reduce the packet in the consult i obtain results but if im ask for a heavy table i obtain this error.

    i have another pc in the same vpn, and this pc dont do the same..

    i cant bealive this incidence dont have fix yet!

     

    Thursday, August 6, 2009 11:00 PM
  • I have encountered the same problem with asp.net 2.0 and sql 2008 server.

    As mentioned above, i have changed the remote login timeout of db instance from 20 to 120 and issue resolved
    I dont think this as a solution although it worked for me.

    what MS is doing on this.....even they dont know about the solution...

    lets see how long its goes
    Sr. Software Engineer, SIEMENS
    • Proposed as answer by camelinckx Thursday, October 8, 2009 9:23 PM
    Tuesday, September 15, 2009 10:32 AM
  • I have found many of the posts in this thread helpful in exploring alternatives to understand and fix my problem so I am reporting my experience for others as well.

    I have a web app that is suffering from a similar, potentially related problem, it most commonly manifests as Empty Recordsets being returned by DbDataAdapter Fill() or ExecuteNonQuery() calls.

    Most commonly it bubbles up to the business layer where it attempts to access either a row, a column from a datatable or even the value of an output SqlParam that we expect to have data but since the recordset is completely empty (no schema even, no column definitions) it usually manifests itself in the form of one of these exceptions:

    System.ArgumentException: Column '{favorite_col_name}' does not belong to table

    System.IndexOutOfRangeException: There is no row at position 0

    System.NullReferenceException: Object reference not set to an instance of an object. (if the SqlParam.Value is null and expected not to be)

    It happens on heavy load and is intermittent.

    Yesterday I moved my tests from heavy load to “extreme” load and for the first time caught the infamous exception which led me to this thread.

    System.Data.SqlClient.SqlException: A transport-level error has occurred when receiving results from the server. (provider: TCP Provider, error: 0 - An existing connection was forcibly closed by the remote host.)

    I have an open case with Microsoft support which so far has yielded nothing interesting, I’m actually appalled by the lack of knowledge around this (whereas I am a very proud .Net technologist).

    During my next searches I found this additional blog post which I think summarizes very well the main findings mentioned above on this thread:

    http://blogs.msdn.com/sqlprogrammability/archive/2008/05/27/sql-server-intermittent-connectivity-issue.aspx

    Peace & happy debugging.

    Thursday, October 8, 2009 9:26 PM
  • I fixed this problem on our server (Windows 2003 Standard connecting to a remote SQL2005 server) by installing a recent network card driver from Intel.

    Before,  the server used the default microsoft windows 2003 drivers for the onboard Intel Gigabit NIC.

    Thursday, November 5, 2009 6:31 AM
  • Chris Please update this thread with the driver details with the version numbers. Thanks Danesh
    Wednesday, November 11, 2009 11:50 AM
  • Chris
     
    Please update this thread with the driver details with the version numbers that you replaced the the default microsoft windows 2003 drivers for the onboard Intel Gigabit NIC.
    Also please do mention from where to get it.

    Thanks
    Amarnath Kushnoor
    Monday, November 30, 2009 12:54 PM
  • A connection was successfully established with the server, but then an error occurred during the login process. (provider: TCP Provider, error: 0 - The specified network name is no longer available.)
    
    Have anyone found an answer. This is  a really weird. My workaround is to copy the entire folder (containing the exe) to another folder on the same computer. This workaround works but our client also experience the same problem, too. We can't tell them to just do the "copying" workaround each time the problem occurs. We need the solution.

    1.) .NetFramework 2 sp1
    2.) WindowsXP SP3 connecting to Windows 2003 Enterprise Edition R2 SP2
    3.) SQL Server 2000 sp4
    Tuesday, January 26, 2010 6:25 AM
  • It seems that my problem has gone away.
    All I did was re-install SQL Server 2000 SP4.
    I will be observing this fix for a few days. I hope that the problem stays fixed for good.
    Thursday, February 11, 2010 6:17 AM
  • We also have the same problem.
    - Windows Server 2008 R1 64bit
    - SQL Server std. 2008 64bit
    - all possible updates and services packs installed

    We tried most of the proposals in this thread and several made the problem occur less, but it never went away completely. Only disabling pooling helped 100%. This is performance wise not an option. What helped best was to reduce the size of the connection pool to a number only very little above the max. number of concurrent connection ever used. This helps minimize the number of connections that isn't used for a long time. We could decrease this number significantly. Also it helped to increase the 'Remote Login Timeout', even though the documentation on this option indicates it can't possible have anything to do with the issue.

    All in all, this is only a workaround, not a solution, the error still happens albeit much less frequently.
    Thursday, March 4, 2010 3:38 PM
  • p.s. We have an open MS Support Call in which we we tell about this thread and our own findings. So far MS did not come up with any direct solution.

    p.s. Due to maintenance we had to move our database server onto the webserver and expected the error to go away. NOT! It just changed to the same error but then with the Shared Memory Provider instead of the TCP Provider. Conclusion that it has nothing to do with networking seems appropriate.
    Thursday, March 4, 2010 3:43 PM
  • I have posted on this thread a few times with various solutions or tweaks that did help - for awhile.  For the record nothing really worked until finally I setup Active Directory using a network consultant.  This removed all volatility between the machines that were trying to connect via the VPN to the sql server.

    I'm developer/analyst not a network admin.  Get someone good to look at how your local network is setup as this was clearly the issue in my case.

    The consultant only cost $200 but was priceless as this error was a major pain.

    I hope this helps...
    Thursday, March 4, 2010 9:15 PM
  • Well, looks like Microsoft is aware of the problem.

    Have anyone here tried this?

    http://msdn.microsoft.com/en-us/library/ms187005.aspx

    Troubleshooting: Connection Forcibly Closed

     

    This error may occur when connecting to SQL Server using TCP/IP.

      Error Text

    The error can occur in the following formats:

    • TCP_PROV: An existing connection was forcibly closed by the remote host.
    • "ProviderNum: 7, Error: 10054, ErrorMessage: "TCP Provider: An existing connection was forcibly closed by the remote host ..."
    • Unhandled Exception: 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.)
      Typical Causes of This Error

    The following table lists typical causes and resolutions for this error.

    CauseResolution

    Client is connecting with an unsupported version of the SQL Server Native Client.

    Update the client computer to the server version of the SQL Server Native Client.

    Faulty network hardware is dropping portions of the TCP traffic.

    Use network monitoring programs to analyze TCP SYN, ACK, and FIN messages.

    The SynAttackProtect setting may be dropping connections.

    See the section "Connections May Be Forcibly Closed When Running on Windows Server 2003 SP1" that follows.

    Connections May Be Forcibly Closed When Running on Windows Server 2003 SP1

    When testing scalability with a large number of client connection attempts to an instance of the SQL Server Database Engine running on Windows Server 2003 Service Pack 1, Windows may drop connections if the requests arrive faster than SQL Server can service them. This is a security feature of Windows Server 2003 Service Pack 1, which implements a finite queue for incoming TCP connection requests.

    To resolve this issue, use the regedit.exe utility to add the following registry key:

    KeyTypeNameValue

    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\

    DWORD

    SynAttackProtect

    00000000

    ms187005.security(en-us,SQL.100).gifSecurity Note:

    Setting this registry key may expose the server to a SYN flood, denial-of-service attack. Add this registry value only if necessary and with an understanding of the security risks. Remove this registry value when testing is complete.


    Cheers,
    F.

     

    • Proposed as answer by Feu Saturday, March 27, 2010 5:32 PM
    Saturday, March 27, 2010 5:31 PM
  • Bumping this (once again)  We're having this issue sporadically with SQL Server 2008 R2 Enterprise.  I've temporarily disabled pooling while the pilot group is providing feedback.  This is a SharePoint 2007 portal with custom web parts querying the SQL cluster for data via a SharePoint service.

    If anyone has any clue I would be very greatful (what's your favorite beverage?) :)

    Monday, May 17, 2010 6:08 PM
  • Here is solution for this trouble, I havent test it yet but I guess it will work

    http://support.microsoft.com/kb/555938

     

    Gokhan

    Wednesday, August 11, 2010 2:09 PM
  • Another thing to check would be the Sql Max Server memory setting.  If it's set to default, it can use up all the memory on the server thus hang processes or even the system while it tries to trim back.   
    Monday, September 20, 2010 11:06 AM
  • We had the same issue - TCP error - end fought it for weeks. We eventually found the solution by accident; we were fixing some routes in a PIX box and found an entry that had been keyed in backwards. When we fixed the entry the problem went away.

    Every one of the proposed solutions helped - a little - but the problem never went away. Until that is - the router address was corrected. There was some mention that this could be network related - in our case it was and cleaning up the router table fixed the issue for us. Thank goodness!!

    Monday, October 11, 2010 8:30 PM
    • Marked as answer by Papy Normand Thursday, October 11, 2012 7:09 PM
    Saturday, October 30, 2010 8:48 AM
  • Just upgraded a project from Visual Studio 2010 SP1 to Visual Studio 2012 and started to get this error.

    In the end, for us, we need to fully-qualify the server name in the connection string.

    • Marked as answer by Papy Normand Thursday, October 11, 2012 7:09 PM
    Thursday, September 20, 2012 8:02 PM
  • Is this problem SERIOUSLY still not solved?  I've had a VB.Net application running perfectly for a couple years now running on Windows XP clients connecting to MS SQL Server 7 running on a Windows NT 4 machine with ZERO problems.  Now that I want to run the application on Windows 7 clients, I can't get around this error.  The server and clients are all on the same gigabit wired network and the application works perfectly from the XP clients whether wired, wifi, or VPN.  The Windows 7+ machines don't work, ever.  From a factory fresh Win7-pro to Win8.1.  Over nine years and no solid solution?
    Wednesday, January 28, 2015 9:50 PM