Please Help..Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding

StackOverflow https://stackoverflow.com/questions/9456644

Question

I have tried everything.from ;Connection Timeout=600; to pooling='true'; Max Pool Size=200" to everything..I have a query in the data source which i need to run and it takes some time.This Timeout is really annoying !

Was it helpful?

Solution

You can set the select command's timeout value in SqlDataSource's Selecting event:

protected void SqlDataSource1_Selecting(object sender, SqlDataSourceSelectingEventArgs e)
{
e.Command.CommandTimeout = 30;  //or more time....
}

OTHER TIPS

Are you using ADO.NET? If so, try using:

SqlCommand cmd = new SqlCommand();
cmd.CommandTimeout = 600;
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top