The timeout has reached. The timeout time has passed or the server has not responded before the operation is completed.

Source: Internet
Author: User

There are two methods:

1. Add the following statement to Web. config:

<System. Web>

<Httpruntime maxrequestlength = "102400" executiontimeout = "720"/>

</System. Web>

Explanation from msdn:
Httpruntime is used to configure Asp.net HTTP runtime settings to determine how to handle Asp.net applications. Program .
Executiontimeout: maximum time limit allowed for request execution, in seconds
Maxrequestlength: indicates the maximum file upload size supported by ASP. NET. This restriction can be used to prevent DoS attacks caused by a large number of files being transferred to the server. The specified size is in KB. The default value is 4096 KB (4 MB ).
Usefullyqualifiedredirecturl: indicates whether the client redirection is fully qualified (in the "http: // server/path" format, which is required by some mobile controls ), or indicates whether to send relative redirection to the client. If it is true, all non-fully-qualified redirects are automatically converted to a fully-qualified format. False is the default option.
Minfreethreads: specifies the minimum number of free threads allowed to execute new requests. ASP. NET allows a specified number of threads to remain free by appending threads to complete the requests it processes. The default value is 8.
Minlocalrequestfreethreads: the minimum number of free threads allowed to execute new local requests maintained by ASP. NET. The number of threads is reserved for requests passed in from the local host to prevent some requests from sending subrequests to the local host during processing. This avoids possible deadlocks caused by recursive re-entering the web server.
Apprequestqueuelimit: indicates the maximum number of requests that ASP. NET will queue for the application. Requests are queued when there are not enough free threads to process requests. When the queue exceeds the limit specified in this setting, the incoming request is rejected through the "503-the server is too busy" error message.
Enableversionheader: Specifies whether ASP. NET should output the version header. Microsoft Visual Studio 2005 uses this attribute to determine the current ASP. NET version. This attribute is not required for the production environment and can be disabled.

2. The solution is simple.CodeAnd assign a large value to the commandtimeout attribute. For example, for 60 seconds, the default timeout value of sqlcommand is 30 seconds. You can also set the timeout attribute of sqlcommand to 0.

Note:

The value 0 indicates that there is no limit. The value 0 should be avoided in commandtimeout; otherwise, the command will be waiting for execution indefinitely.

[C #]
Public void createmysqlcommand ()
{
Sqlcommand mycommand = new sqlcommand ();
Mycommand. commandtimeout = 15;
Mycommand. commandtype = commandtype. text;
}

See as: http://msdn.microsoft.com/library/CHS/cpref/html/frlrfsystemdatasqlclientsqlcommandclasscommandtimeouttopic.asp? Frame = true

Sqldataadapter da = new sqldataadapter ();
Da. selectcommand. commandtimeout = 60;

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.