Exemplo n.º 1
0
        private void btconnectsql_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            Form frm = IsActive(typeof(FrmSQLConnect));

            if (frm == null)
            {
                var f = new FrmSQLConnect();
                f.MdiParent = this;
                f.Show();
            }
            else
            {
                frm.Activate();
            }
        }
Exemplo n.º 2
0
        private void btconnectsql_ItemClick(object sender, ItemClickEventArgs e)
        {
            Form frm = IsActive(typeof(FrmSQLConnect));

            if (frm == null)
            {
                var forms = new FrmSQLConnect();
                forms.MdiParent = this;
                forms.Show();
            }
            else
            {
                frm.Activate();
            }
        }
        private void ConnectDatabase()
        {
            string strConnectionString = DatabaseConnection.Instance.GetConnectionString(Application.StartupPath + "\\DATA.XML");

            try
            {
                sqlCon = new SqlConnection(strConnectionString);
                sqlCon.Open();
            }
            catch (Exception)
            {
                MessageBox.Show("Lỗi ConnectDatabase: Không thể kết nối với CSDL, Vui lòng thử cấu hình lại kết nối", "Lỗi kết nối", MessageBoxButtons.OK, MessageBoxIcon.Error);
                FrmSQLConnect form = new FrmSQLConnect();
                form.Show();
            }
        }
Exemplo n.º 4
0
        private void btConnectSQL_Click(object sender, EventArgs e)
        {
            var f = new FrmSQLConnect();

            f.ShowDialog();
        }