ASP.NET - Timeout expired. - Asked By amala mandarapu on 26-Jun-12 06:45 AM

Jitendra Faye replied to amala mandarapu on 26-Jun-12 06:48 AM
For this increase TimeOut in web.config file like this-

 <system.web>
               
<httpRuntime executionTimeout="value"/>
       
</system.web>

Vikram Singh Saini replied to amala mandarapu on 26-Jun-12 06:50 AM
Timeout expired error occurs when there is long running query or when there is lot of load on server. So for the moment server is unable to process your request.

You can go with the link http://msdn.microsoft.com/en-us/library/ms190181%28v=sql.105%29.aspx for more details.
amala mandarapu replied to Jitendra Faye on 26-Jun-12 06:56 AM
hi,
i am facing this error.
"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."

i my project i am using sqlhelper.cs file for the database to execute. and one doubt is where can i find sql connection timeout in database.when i was debugging the code it is showing connectiontimeout as 15.i am getting the solution for this.please help me in solving the problem.

thanks
Amala
Lalit M replied to amala mandarapu on 26-Jun-12 06:59 AM
How to avoid Timeout expired check this link: http://dotnethangout.blogspot.in/2007/02/timeout-expired.html
dipa ahuja replied to amala mandarapu on 26-Jun-12 08:02 AM
Increase the timeOut attribute of your connection
 
 <add name="ConnectionString" connectionString="Data Source=;Initial Catalog=;Persist Security Info=True;User ID=sa;Password=sa@123;Connect Timeout=200" providerName="System.Data.SqlClient"/>
</connectionStrings>
 
OR
 SqlConnection conn = new SqlConnection("ConnString");
 SqlCommand comm = new SqlCommand();
 comm.CommandTimeout = 120;
 
 
amala mandarapu replied to dipa ahuja on 26-Jun-12 08:07 AM
hi,
i used all these eventhough facing the same problem.
KCH replied to amala mandarapu on 27-Jun-12 01:06 AM

Hi....
Try to set TimeOut  for ConnectionString,  for example:

<add key="DBConnection" value="server=LocalHost;uid=sa;pwd=;database=DataBaseName;Connect Timeout=200; pooling='true'; Max Pool Size=200"/>

Or add the statement: sqlSelectCommand1.CommandTimeout = 200;

You can try to set a larger value