asp.net查询数据响应时间问题
我有个查询语句 数据量很大,当我执行查询时,如果在规定的响应时间(多少秒)内查询不完,那么我就直接弹出一个提示 查询超时。响应时间是在web.config里面进行设置。数据库为sqlserver.应该怎么弄呢。大神来帮忙了。 ASP.NET 连接超时
[解决办法]
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
...
<system.web>
<httpRuntime executionTimeout="90" maxRequestLength="4096"
useFullyQualifiedRedirectUrl="false"
minFreeThreads="8"
minLocalRequestFreeThreads="4"
appRequestQueueLimit="100" />
</system.web>
...
</configuration>
;Connection Timeout=30to your connection string and specify the value you wish.
{
connection.Open();
cmd.CommandTimeout = Times;
int rows = cmd.ExecuteNonQuery();
connection.Close();
return rows;
}
catch (System.Data.SqlClient.SqlException E)
{
connection.Close();
throw new Exception(E.Message);
}
}
}
}