[Original] ASP. NET timeout settings 2

Source: Internet
Author: User
[Original] ASP. NET timeout settings

1. Connection timeout for IIS> [website]> Properties>. The default value is 120 seconds.
2. manually add httpruntime to Web. config, as shown in figure
<System. Web>
<Httpruntime maxrequestlength = "1000000" executiontimeout = "2000"/>
</System. Web>
3. You must set the timeout attribute when executing the WebService synchronously, as shown in figure
Compilersvr. myfavoritesservice compiler = new FDN. DMS. Controls. compilersvr. myfavoritesservice ();
Compiler. Timeout = 2000000; // millisecond

Reference please declare this article source http://www.cnblogs.com/linn !!!

If you use fill to send a large amount of data to a table or Dataset
Datatable rettable = new datatable ();
Rettable. tablename = tablename;
Sqlconnection con = new sqlconnection (m_sqlconnectionstring );
Con. open ();
Sqldataadapter SDA = new sqldataadapter (SQL, con );
SDA. Fill (rettable );
Con. Close ();
Return rettable;

Even if you set connectstring <add key = "connectionstring" value = "Data Source = (local); initial catalog = http://www.cnblogs.com/linn/;persist Security info = false; user id = sa; Password =; packet size = 8192; connection timeout = 600 "/> still times out. Only commandtimeout is used:
Sqldataadapter SDA = new sqldataadapter ();
Sqlcommand sqlcmd = new sqlcommand ();
Dataset dt = new dataset ();
Sqlconnection con = new sqlconnection (m_sqlconnectionstring );
Con. open ();
Sqlcmd. Connection = con;
Sqlcmd. commandtext = SQL;
Sqlcmd. commandtimeout = 600;
// Sqldataadapter SDA = new sqldataadapter (SQL, con );
SDA. selectcommand = sqlcmd;
SDA. Fill (DT );
Con. Close ();
Return DT. Tables [0];

Related Article

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.