Thursday, November 12, 2009, 05:08 PM -
SQLPosted by Administrator
The timeout period elapsed prior to completion of the operation or the server is not responding.
This error occured very often in Asp.net Application. There are many solutions to resolve this problem. Lets Try these solutions one by one.
Solutions 1 Try adding a Connect Timeout in the web.config
<add key="DBConnection" value="server=LocalHost;uid=sa;pwd=;database=DataBaseName;Connect Timeout=200; pooling='true'; Max Pool Size=200"/>
Solutions 2 The solution is simple, change the CommandTimeout property of your SqlCommand object.
The Connect Timeout attribute of a connection string determines how long a SqlConnection Object runs before it stops attempting to connect to a server.
Sample Code
Dim myCommand As New SqlCommand(sql, myConnection, myTrans)
myCommand.CommandType = CommandType.StoredProcedure
myCommand.CommandTimeout = 0
When 0 is for no limit.
Solution 3 The "Timeout expired" error commonly occurs when an instance of the SQL Server Database Engine is not running, when the server name was typed incorrectly, or when there are network problems or firewalls.
Following are the cause and their solutions
A- Server name was typed incorrectly.
Try again with the correct server name.
B- The SQL Server service on the server is not running.
Start the instance of SQL Server Database Engine.
C- The TCP/IP port for the Database Engine instance is blocked by a firewall.
Configure the firewall to permit access to the Database Engine.
D- Database Engine is not listening on port 1433 because it has been changed, or because it is not the default instance, and the SQL Server Browser service is not running.
Either start the SQL Server Browser service, or connect specifying the TCP/IP port number.
F- The SQL Server Browser service is running but UDP port 1434 is blocked by a firewall.
Either configure the firewall to permit access to the UPD port 1434 on the server, or connect specifying the TCP/IP port number.
G- The client and server are not configured to use the same network protocol.
Using SQL Server Configuration Manager, confirm that both the server and the client computers have at least one enabled protocol in common.
H- The network cannot resolve the server name to an IP address. This can be tested using the PING program.
Fix the computer name resolution problem on your network or connect using the IP address of the server. This is not a SQL Server problem. For assistance, see your Windows documentation or your network administrator.
I- The network cannot connect using the IP address. This can be tested using the PING program.
Fix the TCP/IP problem on your network. This is not a SQL Server problem. For assistance, see your Windows documentation or your network administrator.