public static bool TryCon(string strCon) { bool flag = false; DB_OPT db_opt = null; try { db_opt = new DB_OPT(); db_opt.OpenTest(strCon); flag = true; } catch (Exception exception) { new ExceptionLog.ExceptionLog { ErrClassName = "EIP_User.Login", ErrMessage = exception.Message.ToString(), ErrMethod = "TryCon()" }.WriteExceptionLog(true); } finally { if (db_opt != null) { db_opt.Close(); } } return flag; }