a SQLDataSource object has a default command timeout of 90 seconds. Often you may be tasked with returning large amounts of data or doing some other tedious processing on the database side that takes while. If you exceed this you'll get the pain-in-the-ass runtime exception - Sys.WebForms.PageRequestManagerServerErrorException: Timeout expired.
To work-around this when all other methods have failed, I increase the command timeout value of the SqlDataSource object via it's SELECTING event as such:
protected void sdsYourSQLDataSource_Selecting(object sender, SqlDataSourceSelectingEventArgs e)
{
e.Command.CommandTimeout = 360;
}
The value is set in SECONDS. Hope this helps
1 comment:
Thank you, this solved my problem. I was messing around with ScriptManager, HttpContext server timeout settings, and even ConnectionString settings. I didn't even think to check the CommandTimeout, and it worked perfectly.
Post a Comment