Exemple #1
0
        private bool TestConnecting()
        {
            bool result = false;

            try
            {
                DataOracle dataOracle = new DataOracle();
                dataOracle.host     = txtHost.Text;
                dataOracle.port     = txtPort.Text;
                dataOracle.sid      = txtSid.Text;
                dataOracle.user     = txtUser.Text;
                dataOracle.password = txtPassword.Text;
                DBConnecting.conn   = DBConnecting.GetDBConnection(dataOracle);
                DBConnecting.conn.Open();
                lbStatus.ForeColor = Color.LimeGreen;
                lbStatus.Text      = "Successful connection";
                result             = true;
                DBConnecting.conn.Close();
            }
            catch (Exception ex)
            {
                DBConnecting.conn.Close();
                lbStatus.ForeColor = Color.Red;
                lbStatus.Text      = "Connection failed";
                MessageBox.Show("Lỗi: " + ex.Message, "Thông báo!");
            }
            return(result);
        }
Exemple #2
0
        private bool TestConnecting()
        {
            bool result = false;

            try
            {
                SetLoading(displayLoader: true);
                Thread.Sleep(3000);
                DataOracle oracle = new ReadWriterConfig().ReadConfigDataBase();
                DBConnecting.conn = DBConnecting.GetDBConnection(oracle);
                DBConnecting.conn.Open();
                result = true;
                DBConnecting.conn.Close();
            }
            catch
            {
            }
            return(validateDatabase = result);
        }
Exemple #3
0
        private bool TestConnecting()
        {
            bool result = false;

            try
            {
                SetLoading(displayLoader: true);
                Thread.Sleep(3000);
                DataOracle oracle = new ReadWriterConfig().ReadConfigDataBase();
                DBConnecting.conn = DBConnecting.GetDBConnection(oracle);
                DBConnecting.conn.Open();
                result = true;
                DBConnecting.conn.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show("Lỗi: " + ex.Message, "Thông báo!");
            }
            return(result);
        }
Exemple #4
0
        private bool TestConnecting()
        {
            bool result = false;

            try
            {
                DataOracle oracle = new ReadWriterConfig().ReadConfigDataBase();
                DBConnecting.conn = DBConnecting.GetDBConnection(oracle);
                DBConnecting.conn.Open();
                lbStatus.Text = "Kết nối thành công";
                result        = true;
                DBConnecting.conn.Close();
            }
            catch (Exception ex)
            {
                DBConnecting.conn.Close();
                lbStatus.Text = "Kết nối không thành công";
                MessageBox.Show("Lỗi: " + ex.Message, "Thông báo!");
            }
            return(result);
        }