asp.net查询数据响应时间问题
我有个查询语句 数据量很大,当我执行查询时,如果在规定的响应时间(多少秒)内查询不完,那么我就直接弹出一个提示 查询超时。响应时间是在web.config里面进行设置。数据库为sqlserver.应该怎么弄呢。大神来帮忙了。
------解决方案--------------------<?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>
------解决方案--------------------also you could append
;Connection Timeout=30
to your connection string and specify the value you wish.
------解决方案--------------------config
<system.web>
<httpRuntime maxRequestLength="102400" executionTimeout="720" />
</system.web>
------解决方案--------------------代码
SqlConnection con = new SqlConnection("server=.;database=myDB;uid=sa;pwd=password;Connect Timeout=500")
------解决方案-------------------- public static int ExecuteSqlByTime(string SQLString, int Times)
{
using (SqlConnection connection = new SqlConnection(connectionString))
{
using (SqlCommand cmd = new SqlCommand(SQLString, connection))
{
try