Bhavesh Vankar

Bhavesh Vankar

  • 753
  • 1.2k
  • 89.4k

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)