Previous values also displayed in to the datagridview. how we clear the datagridview , when we enter the value 2nd time into textbox.
private void textBox2_TextChanged(object sender, EventArgs e)
{
lpogridview.Visible = true;
lpogridview.DataSource = null;
cmd.CommandText = "select itemcode,itemname,unit,lpoqty,lporate,lpodiscount,lpovalue from lpo l inner join item i on l.itemid=i.itemid where lpono='" + textBox2.Text + "'";
da.SelectCommand = cmd;
da.Fill(ds, "item11");
DataTable dt11 = ds.Tables["item11"];
lpogridview.AutoGenerateColumns = false;
lpogridview.DataSource =dt1
}