protected void GridView1_RowUpdating1(object sender, GridViewUpdateEventArgs e)
{
int ID = (Convert.ToInt32(((Label)GridView1.Rows[e.RowIndex].FindControl("Label1")).Text));
string FirstName = ((TextBox)GridView1.Rows[e.RowIndex].FindControl("TextBox2")).Text;
string LastName = ((TextBox)GridView1.Rows[e.RowIndex].FindControl("TextBox3")).Text;
string EmailID = ((TextBox)GridView1.Rows[e.RowIndex].FindControl("TextBox4")).Text;
string MobileNumber = ((TextBox)GridView1.Rows[e.RowIndex].FindControl("TextBox5")).Text;
string Class = ((TextBox)GridView1.Rows[e.RowIndex].FindControl("TextBox6")).Text;
string Stream = ((TextBox)GridView1.Rows[e.RowIndex].FindControl("TextBox7")).Text;
string query = "UPDATE REIGISTRATION SET FirstName='" + FirstName + "', LastName='" + LastName + "', EmailID='" + EmailID + "', MobileNumber='" + MobileNumber + "', Class='" + Class + "', Stream='" + Stream + "' WHERE ID='" + ID + "'";
string cs = "Data Source=USER-PC\\LOCAL;Initial Catalog=STUDENT;Integrated Security=True";
SqlConnection con = new SqlConnection(cs);
SqlCommand cmd = new SqlCommand(query, con);
con.Open();
cmd.ExecuteNonQuery();
con.Close();
GridView1.EditIndex = -1;
grid_binding();
}