服务器超时.
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();