Solved

PRoblem with SQL server connecting

Posted on 2010-09-03
4
2,997 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
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.

815 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now