W
wwwmike
Problem: When my provider shuts down the SQL Server IIS receives a few
error messages and then switches the site to 'SERVICE UNAVAILABLE'.
Before IIS kills itself it is friendly enough to send me an error
message.
****ERROR MESSAGE 1******
System.Data.SqlClient.SqlException: An error has occurred while
establishing a connection to the server. When connecting to SQL Server
2005, this failure may be caused by the fact that under the default
settings SQL Server does not allow remote connections.
This error message happens when the server is offline and my ASP.NET 2
code tries to open a connection
.....
myConnection.Open()
.....
The last error message I receive is
*****ERROR MESSAGE 2*****
System.InvalidOperationException: Timeout expired. The timeout period
elapsed prior to obtaining a connection from the pool. This may have
occurred because all pooled connections were in use and max pool size
was reached
I am not sure if the ERROR MESSAGE 2 really is about the connection
pool, since the sql server is already down. But this might trigger IIS
to set my service unavailable.
What can I do in my asp.net code to detectd if a SQL server is online?
error messages and then switches the site to 'SERVICE UNAVAILABLE'.
Before IIS kills itself it is friendly enough to send me an error
message.
****ERROR MESSAGE 1******
System.Data.SqlClient.SqlException: An error has occurred while
establishing a connection to the server. When connecting to SQL Server
2005, this failure may be caused by the fact that under the default
settings SQL Server does not allow remote connections.
This error message happens when the server is offline and my ASP.NET 2
code tries to open a connection
.....
myConnection.Open()
.....
The last error message I receive is
*****ERROR MESSAGE 2*****
System.InvalidOperationException: Timeout expired. The timeout period
elapsed prior to obtaining a connection from the pool. This may have
occurred because all pooled connections were in use and max pool size
was reached
I am not sure if the ERROR MESSAGE 2 really is about the connection
pool, since the sql server is already down. But this might trigger IIS
to set my service unavailable.
What can I do in my asp.net code to detectd if a SQL server is online?