方法1:优化你的SQL脚本或者存储过程,使其 在运行速度上 有所提升
方法2:在配置文件中解决
1、SqlConnection con = new SqlConnection("server=.;database=myDB;uid=sa;pwd=password;Connect Timeout=500")
3、在Web.config配置文件中设置http请求运行时限间
<system.web>
<httpRuntime maxRequestLength="102400" executionTimeout="720" />
</system.web>
方法3:在代码中解决 || cmd.CommandTimeout = 180; //180秒
1.在Sqlhelper.cs中,如下图
2、在UI层代码中直接实现