Search code examples
sql-server-2008datasourceconnection-timeout

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


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 !


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....
    }