Jyoti Jodha

Jyoti Jodha

  • 908
  • 1.7k
  • 347.9k

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)