Jyoti Jodha

Jyoti Jodha

  • NA
  • 1.7k
  • 407.1k

how to select record show in gridview in asp.net

Mar 28 2017 1:56 AM
private void DisplayData()
{
dataGridView1.AutoGenerateColumns = false;
con.Open();
DataTable dt = new DataTable();
adapt = new SqlDataAdapter("select Tax_ID,Tax,percentage from Tax", con);
cmd.Parameters.AddWithValue("@Tax", this.txt_tax.Text.Trim());
cmd.Parameters.AddWithValue("@percentage", this.txt_per.Text.Trim());
cmd.ExecuteNonQuery();
adapt.Fill(dt);
dataGridView1.DataSource = dt;
con.Close();
}
 
 
Tax_Id Don't show in grid view.....??? 

Answers (18)