0

我已经尝试了一切;Connection Timeout=600;。从pooling='true'; Max Pool Size=200"到一切。我在数据源中有一个需要运行的查询,这需要一些时间。这个超时真的很烦人!

4

2 回答 2

1

你在使用 ADO.NET 吗?如果是这样,请尝试使用:

SqlCommand cmd = new SqlCommand();
cmd.CommandTimeout = 600;
于 2012-02-26T20:28:30.693 回答
1

您可以在 SqlDataSource 的 Selecting 事件中设置 select 命令的超时值:

protected void SqlDataSource1_Selecting(object sender, SqlDataSourceSelectingEventArgs e)
{
e.Command.CommandTimeout = 30;  //or more time....
}
于 2012-02-27T00:42:21.367 回答