protected void btnUpdate_Click(object sender, EventArgs e) { if (Page.IsValid) { Contoso.Model.Department dt = new Contoso.Model.Department { Id = Convert.ToInt32(Request.QueryString["id"]), Name = txtName.Text, Budget = TxtBudget.Text, StartDate = Convert.ToDateTime(TxtStartDate.Text), InstructorId = Convert.ToInt32(TxtInstructorId.Text), RowVersion = TxtRowVersion.Text, }; DeptService service = new DeptService(); service.UpdateDept(dt); } }