private void dgkhachhang_CellClick(object sender, DataGridViewCellEventArgs e) { int i = e.RowIndex; DataTable a; try { a = buskh.getAllData(); tbmakh.Text = a.Rows[i]["makh"].ToString(); tbtenkh.Text = a.Rows[i]["tenkh"].ToString(); //cbloaikh.Text = a.Rows[i]["maloaikh"].ToString(); tbemail.Text = a.Rows[i]["email"].ToString(); tbdiachi.Text = a.Rows[i]["diachi"].ToString(); tbsdt.Text = a.Rows[i]["Sdt"].ToString(); dtpngaysinh.Text = a.Rows[i]["Ngaysinh"].ToString(); if (a.Rows[i]["Gioitinh"].ToString() == "Nam") { rbnam.Checked = true; } else { rbnu.Checked = true; } } catch { TextBNull(); } }