public static void closeConnection() { try { if (SQLC.State == ConnectionState.Open) { SQLC.Close(); } } catch (Exception ex) { MessageBox.Show("Can't close SQL server"); } }