private void btnKetNoi_Click(object sender, EventArgs e) { try { DungChung dc = new DungChung(); dc.KetNoi(txtServer.Text, txtDatabase.Text, txtUsername.Text, txtPassword.Text); frmDangNhap f = new frmDangNhap(); this.Hide(); f.ShowDialog(); } catch (Exception tt) { MessageBox.Show("Kết nối thất bại"); } }
private void Form1_Load(object sender, EventArgs e) { dc.KetNoi(); lbHang.DataSource = hang.getListHang(); lbHang.DisplayMember = "TenHang"; lbHang.ValueMember = "MaHang"; cbbTenXe.DataSource = oto.getListOto(); cbbTenXe.DisplayMember = "TenXe"; cbbTenXe.ValueMember = "MaXe"; dsHoaDon = hoaDon.getListHoaDon(); dataGridView1.DataSource = dsHoaDon; LoadXe(); }
private void Form1_Load(object sender, EventArgs e) { dc.KetNoi(); }
private void frmMenu_Load(object sender, EventArgs e) { dc.KetNoi(); ds = dangNhap.getListDangNhap(); dataGridView1.DataSource = ds; }