SqlException
SqlException
If the exception is:
System.Data.SqlClient.SqlException: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
solution
--------
It means Command is taking long in the database and has been killed. The default time of 30 seconds should be increased by using the "CommandTimeout" field on the "Command" object.
e,g
SqlCommand sqlcom = connection.CreateCommand();
sqlcom.CommandTimeout = 60; // Increase according to requirement
sqlcom.CommandText = sqlText;
http://www.connectionstrings.com/Articles/Show/all-sql-server-connection-string-keywords
apply in the settings of sqlsever...
an option and set timeout there to 600 or something
also in the connection string apply pool=false
http://authors.aspalliance.com/aspxtreme/sys/data/sqlclient/SqlConnectionClassConnectionString.aspx
or not need to write timeout just give timeout=600 in the settings of sqlserver