Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

PRoblem with SQL server connecting

Posted on 2010-09-03
4
3,020 Views
Last Modified: 2012-06-22
hi we have come in today and our webserver and SQL server are giving the following problem, the server has been fine fine for days and nothing has changed.

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

The client was unable to establish a connection because of an error during connection initialization process before login. Possible causes include the following:  the client tried to connect to an unsupported version of SQL Server; the server was too busy to accept new connections; or there was a resource limitation (insufficient memory or maximum allowed connections) on the server. (provider: TCP Provider, error: 0 - An existing connection was forcibly closed by the remote host.)
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: The client was unable to establish a connection because of an error during connection initialization process before login. Possible causes include the following:  the client tried to connect to an unsupported version of SQL Server; the server was too busy to accept new connections; or there was a resource limitation (insufficient memory or maximum allowed connections) on the server. (provider: TCP Provider, error: 0 - An existing connection was forcibly closed by the remote host.)

Source Error:


Line 34:                     string cmd = "Select [filename] from [tbl_images] where [destination] = 'Home' And [is_video]='0'";
Line 35:                     _data.CommandText = cmd;
Line 36:                     _sqlConnection.Open();
Line 37:
Line 38:                     if (_data.ExecuteScalar() != null)
 

Source File: d:\web_docs\lifein.co.uk\Default.aspx.cs    Line: 36

Stack Trace:


[SqlException (0x80131904): The client was unable to establish a connection because of an error during connection initialization process before login. Possible causes include the following:  the client tried to connect to an unsupported version of SQL Server; the server was too busy to accept new connections; or there was a resource limitation (insufficient memory or maximum allowed connections) on the server. (provider: TCP Provider, error: 0 - An existing connection was forcibly closed by the remote host.)]
   System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +4846887
   System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +194
   System.Data.SqlClient.TdsParserStateObject.WriteSni() +4857590
   System.Data.SqlClient.TdsParserStateObject.WritePacket(Byte flushMode) +254
   System.Data.SqlClient.TdsParser.SendPreLoginHandshake(Byte[] instanceName, Boolean encrypt) +498
   System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, SqlConnection owningObject) +258
   System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject) +90
   System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart) +342
   System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +221
   System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +189
   System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +185
   System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +31
   System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +433
   System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +66
   System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +499
   System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +65
   System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +117
   System.Data.SqlClient.SqlConnection.Open() +122
   _Default.Page_Load(Object sender, EventArgs e) in d:\web_docs\lifein.co.uk\Default.aspx.cs:36
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
   System.Web.UI.Control.OnLoad(EventArgs e) +99
   System.Web.UI.Control.LoadRecursive() +50
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627

 


--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.3615; ASP.NET Version:2.0.50727.3614
0
Comment
Question by:davidcairns90
  • 2
4 Comments
 
LVL 4

Accepted Solution

by:
dschauhan82 earned 333 total points
ID: 33594771
<add name="DatabaseConnection" connectionString="Data Source=.\SQLEXPRESS;Initial Catalog=DatabaseName;Integrated Security=SSPI" providerName="System.Data.SqlClient"/>

simplely use the Management Studio with the correct connection string as listed above

Please check your connection string.. may the problem is in connection string
0
 
LVL 4

Assisted Solution

by:dschauhan82
dschauhan82 earned 333 total points
ID: 33594777
There could be a firewall on the server blocking the ports needed to connect. Try temporarily disabling the firewall to see if that helps, or Google for the ports used by Sql Server and make sure they aren't blocked.

references to ports used
http://www.sqlcoffee.com/Tips0003.htm
http://myitforum.com/cs2/blogs/dhite/archive/2006/07/05/21831.aspx

Hope this help u..
0
 
LVL 6

Expert Comment

by:Jerryuk007
ID: 33596032
Which version of MSSQL?

In MSSQL Server, Query Analyser, run the command SP_WHO2 to see how many connections are currently open.
Then run the Stored Procedure sp_configure and check the number of "User Connections" and "Open Objects" which your server allowed.

It might just be some unclosed Client connections.

If that doesn't help, then stop/restart the MSSQL Server Engines.

Jerry
0
 
LVL 2

Assisted Solution

by:SrinathKomirishetty
SrinathKomirishetty earned 167 total points
ID: 33634644
Check that Remote Connections are enabled or not..

Please refer following url to enable remote connection  http://support.microsoft.com/kb/914277
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Add a step to a system backup job 6 15
Testing of the web services 1 32
SSMS Opening Mode 9 18
SQL 2012 clustering 9 11
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question