Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

ERROR TIMOUT EXPIRED .....HOW TO RESOLVE THE PROBLEM Expand / Collapse
Author
Message
Posted Tuesday, February 11, 2014 4:24 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Sunday, April 6, 2014 12:03 AM
Points: 30, Visits: 119
I GOT ERROR LIKE BELOW..............................

Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached.

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.InvalidOperationException: Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached.

Source Error:


Line 624: //string value1 = ddlCatogiries.SelectedItem.Text;
Line 625: SqlConnection con = new SqlConnection("Data Source=SRR-PC;Initial Catalog=CRPmerged;Persist Security Info=True;User ID=sa;Password=123");
Line 626: con.Open();
Line 627: SqlCommand cmd = new SqlCommand("select ReferMiddleName,ReferMemberId,SurName,MiddleName,FatherName,Mobile,DNO,Street,Colony,Location,Qualification from Registration4 where VoterIdNo ='" + TextBox1.Text + "' ", con);
Line 628: SqlDataAdapter da = new SqlDataAdapter(cmd);

Source File: c:\EMP1\verification.aspx.cs Line: 626

Stack Trace:


[InvalidOperationException: Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached.]
System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +4871162
System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +117
System.Data.SqlClient.SqlConnection.Open() +122
_Registration.BindGridview2() in c:\EMP1\demoverification.aspx.cs:626
_Registration.TextBox1_TextChanged(Object sender, EventArgs e) in c:\EMP1\demoverification.aspx.cs:654
System.Web.UI.WebControls.TextBox.OnTextChanged(EventArgs e) +8763286
System.Web.UI.WebControls.TextBox.RaisePostDataChangedEvent() +55
System.Web.UI.WebControls.TextBox.System.Web.UI.IPostBackDataHandler.RaisePostDataChangedEvent() +10
System.Web.UI.Page.RaiseChangedEvents() +165
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1485
Post #1540127
Posted Tuesday, February 11, 2014 4:45 AM
SSChasing Mays

SSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing Mays

Group: General Forum Members
Last Login: Today @ 1:02 AM
Points: 626, Visits: 1,136
did you tried to connect to the server from SSMS with the same credentials you have in connection string?
Post #1540133
Posted Tuesday, February 11, 2014 5:43 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Tuesday, February 11, 2014 6:43 AM
Points: 2, Visits: 14
1. Make sure you are closing the connection after each request made to server. You can check the open connections using below T-SQL.

SELECT
DB_NAME(dbid) as DBName, status,
COUNT(dbid) as NumberOfConnections,
loginame as LoginName
FROM
sys.sysprocesses
WHERE
dbid > 0
GROUP BY
dbid, loginame, status

2. Increase the time out of connection object, default is 30 seconds.
Post #1540152
Posted Tuesday, February 11, 2014 5:53 AM


SSCoach

SSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoach

Group: General Forum Members
Last Login: Yesterday @ 7:32 PM
Points: 15,517, Visits: 27,895
Sounds like your code is opening connections and then not closing them. I would focus there.

----------------------------------------------------
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood..." Theodore Roosevelt
The Scary DBA
Author of: SQL Server 2012 Query Performance Tuning
SQL Server 2008 Query Performance Tuning Distilled
and
SQL Server Execution Plans

Product Evangelist for Red Gate Software
Post #1540157
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse