Ejemplo n.º 1
0
        private void btnTimkiem_Click(object sender, EventArgs e)
        {
            DataSet ds;

            dtKhachHang = new DataTable();
            dtKhachHang.Clear();



            if (rdoMaKH.Checked == true)
            {
                ds = dbKH.TimkiemTheoMaKH(this.txtTimkiem.Text);
            }
            else
            {
                if (rdoTen.Checked == true)
                {
                    ds = dbKH.TimkiemTheoTEN(this.txtTimkiem.Text);
                }
                else
                {
                    ds = dbKH.TimkiemTheoGT(this.txtTimkiem.Text);
                }
            }

            dtKhachHang      = ds.Tables[0];
            dgvKH.DataSource = dtKhachHang;
            dgvKH.AutoResizeColumns();
        }