protected void btnTim_Click(object sender, EventArgs e) { DAO_Entity dao = new DAO_Entity(); string tendetim = txtTimTen.Text; List <DTOKhachHang> kqTim = dao.TimTheoTenKH(tendetim); GridKH.DataSource = kqTim; GridKH.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { try { DAO_Entity daokh = new DAO_Entity(); List <DTOKhachHang> dsKH = daokh.TaoDSKH(); GridKH.DataSource = dsKH; GridKH.DataBind(); } catch (Exception) { Response.Write("<script>alert('Loi tai du lieu!')</script>"); } }