[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];