protected void Page_Load(object sender, EventArgs e) { //Load the Existing Schedule when the Page Loads txtTicketID.Text = Session["TicketID"].ToString(); int id = Convert.ToInt32(txtTicketID.Text); JourneyEntity te = new JourneyEntity(); try { var res = b.Update(te, id); if (res != null) { GridView1.DataSource = res; GridView1.DataBind(); } } catch (Exception ex) { throw ex; } }