private void frmSach_Load(object sender, EventArgs e) { cbNXB.Properties.DataSource = bus.GetDataNXB(); cbNXB.Properties.ValueMember = "MANXB"; cbNXB.Properties.DisplayMember = "TENNXB"; cbTheLoai.Properties.DataSource = bus.GetDataTheLoai(); cbTheLoai.Properties.ValueMember = "MATHELOAI"; cbTheLoai.Properties.DisplayMember = "TENTHELOAI"; if (IsInsert == false) { txtMaSach.Enabled = false; DataTable dt = new DataTable(); dt = bus.GetDataByID(Ma); txtMaSach.Text = Ma; txtTenSach.Text = dt.Rows[0]["TENSACH"].ToString(); txtTenTG.Text = dt.Rows[0]["TENTG"].ToString(); //txtDonGia.Text = dt.Rows[0]["DONGIASACH"].ToString(); txtGiaMua.Text = dt.Rows[0]["GIAMUA"].ToString(); txtDonGia.Text = dt.Rows[0]["GIABAN"].ToString(); txtSoLuong.Text = dt.Rows[0]["SOLUONGKHO"].ToString(); txtMota.Text = dt.Rows[0]["MOTA"].ToString(); cbNXB.EditValue = dt.Rows[0]["MANXB"].ToString(); cbTheLoai.EditValue = dt.Rows[0]["MATHELOAI"].ToString(); } }