public void ConnectDatabase() { InitializeConfig(); using (SqlConnection wCnn = new SqlConnection(_CurrentCnnString.ToString())) { try { wCnn.Open(); wCnn.Close(); } catch (SqlException e) { throw e; } } }
/// <summary> /// /// </summary> /// <param name="pCnnString"></param> /// <returns></returns> public static bool TestConnection(CnnString pCnnString) { using (SqlConnection wCnn = new SqlConnection(pCnnString.ToString())) { try { wCnn.Open(); wCnn.Close(); return(true); } catch (Exception ex) { throw new DataBaseExeption(ex, pCnnString); } } }