Esempio n. 1
0
        void NapSinhVien()
        {
            DataTable dt = new DataTable();

            bus = new BUS_Diem();

            dt = bus.showdata_SinhVien();

            var item = new Dictionary <string, string>();

            foreach (DataRow dr in dt.Rows)
            {
                item.Add(dr["MaSV"].ToString(), dr["MaSV"].ToString() + " - " + dr["HoSV"].ToString() + " " + dr["TenSV"].ToString());
            }
            cbMaSV.DataSource    = new BindingSource(item, null);
            cbMaSV.DisplayMember = "Value";
            cbMaSV.ValueMember   = "Key";
        }