1/// <summary>
2/// Test that the server is connected
3/// </summary>
4/// <param name="connectionString">The connection string</param>
5/// <returns>true if the connection is opened</returns>
6private static bool IsServerConnected(string connectionString)
7{
8 using (SqlConnection connection = new SqlConnection(connectionString))
9 {
10 try
11 {
12 connection.Open();
13 return true;
14 }
15 catch (SqlException)
16 {
17 return false;
18 }
19 }
20}