超时时间已到。在操作完成之前超时时间已过或服务器未响应

服务器超时.
WEB.CONFIG 手工添加httpRuntime,如
<system.web>
 <httpRuntime maxRequestLength="1000000" executionTimeout="2000" />
</system.web>
连接字符串里timeout设置下

command的timeout

          DateTime FiveBeforeDay = DateTime.Now.AddDays(-KeepDays);

                SqlParameter[] parameters = {
                                          new SqlParameter("@Time",FiveBeforeDay)
                                        };
                SqlConnection connection = new SqlConnection(Conn);
                connection.Open();
                SqlCommand cmd = new SqlCommand(ClearDB_lyncplusSQL,connection);
                cmd.CommandTimeout = 600000;
                cmd.Parameters.AddRange(parameters);
                int res = cmd.ExecuteNonQuery();

 

posted @ 2014-06-05 18:16  kanek  阅读(284)  评论(0编辑  收藏  举报