Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. The statement has been terminated

后端 未结 20 2206
臣服心动
臣服心动 2020-11-22 10:23

I have many users on my web site (20000-60000 per day), which is a download site for mobile files. I have remote access to my server (windows server 2008-R2).
I\'ve

20条回答
  •  感情败类
    2020-11-22 11:02

    Default timeout is 15 seconds, to change that, 0 is unlimited, any other number is the number of seconds.

    In Code

    using (SqlCommand sqlCmd = new SqlCommand(sqlQueryString, sqlConnection))
       {
          sqlCmd.CommandTimeout = 0; // 0 = give it as much time as it needs to complete
          ...
        }
    

    In Your Web.Config, "Command Timeout=0;" do not time out, or as below 1 hour (3600 seconds)

      
    

提交回复
热议问题