Bhavesh Vankar

Bhavesh Vankar

  • 762
  • 1.1k
  • 87.3k

Gridview Bind In Asp.net C#

Aug 11 2020 7:22 AM
 
My connection String 
 
con.Open();
SqlCommand cmd = new SqlCommand("Select * from Table", con);
SqlDataAdapter Sda = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
Sda.Fill(dt);
GridView1.DataSource = dt;
GridView1.DataBind();
con.Close();
 
I have taken gridview and i want to bind gridview using above code but record not fetching from table to gridview in Asp.net c# Web Page whats error kindly help me.... 

Answers (3)