First You need to give the command name to the edit link button For Example.
<asp:linkbutton id="lnkEdit" runat="server" commandname="Edit" commandargument="<%# Container.DataItemIndex %>" xmlns:asp="#unknown">
This Link Button Have CommandName = "Edit"
protected void gvreservation_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
string id = ((TextBox)gvreservation.FooterRow.FindControl("txtFCustomerID")).Text;
string name = ((TextBox)gvreservation.FooterRow.FindControl("txtFCustomerName")).Text;
string age = ((TextBox)gvreservation.FooterRow.FindControl("txtFAge")).Text;
string location = ((DropDownList)gvreservation.FooterRow.FindControl("ddlFLocation")).Text;
string class1 = ((DropDownList)gvreservation.FooterRow.FindControl("ddlFClass")).Text;
string sqlstatements = "update reservation set CustomerName='"+name+"',Age='"+age+"',Location='"+location+"',Class='"+class1+"' where CustomerID='"+id+"'";
ocon.Open();
SqlCommand cmd = new SqlCommand(sqlstatements,ocon);
cmd.Parameters.Add("@CustomerID",id);
cmd.Parameters.Add("@CustomerName",name);
cmd.Parameters.Add("@Age",age);
cmd.Parameters.Add("@Location",location);
cmd.Parameters.Add("@Class",class1);
cmd.ExecuteNonQuery();
ocon.Close();
gvreservation.EditIndex = e.NewEditIndex;
Binddata();
}