コード例 #1
0
 private void GiangVien_Load(object sender, EventArgs e)
 {
     textBox1.Enabled = false;
     try
     {
         comboBox1.DataSource    = myloai.LayDanhSachLoai();
         comboBox1.DisplayMember = "TenLoai1";
         comboBox1.ValueMember   = "MaLoai1";
     }
     catch (Exception ex)
     {
         MessageBox.Show("Lỗi" + ex);
     }
     cbKhoa.DataSource    = myKhoa.LayDanhSachKhoa();
     cbKhoa.DisplayMember = "TenKhoa";
     cbKhoa.ValueMember   = "MaKhoa";
     hien();
 }
コード例 #2
0
 private void Lop_Load(object sender, EventArgs e)
 {
     textBox1.Enabled                    = false;
     comboBox1.DataSource                = myKhoabul.LayDanhSachKhoa();
     comboBox1.DisplayMember             = "TenKhoa";
     comboBox1.ValueMember               = "MaKhoa";
     dataGridView1.DataSource            = myLopbul.LayDanhSachLop();
     dataGridView1.Columns[0].HeaderText = "Mã Lớp";
     dataGridView1.Columns[1].HeaderText = "Tên Lớp";
     dataGridView1.Columns[2].HeaderText = "Tên Khoa";
 }