I am using an asp.net gridview and am trying to get my update routine functioning correctly.I am getting errors on various methods I am trying. My insert and delete routines work fine. I am relatively new to EF (using ver 5) but am catching on slowly.My latest attempt is outlined below and is getting the following error;UpdateModel must be passed a value provider or alternatively must be invoked from inside a data-operation method of a control that uses model binding for data binding.I'm not quite sure what that error code means.\[code\]Protected Sub GridView1_RowCommand(sender As Object, e As GridViewCommandEventArgs) ' This just provides easier access to the Cells in the GridView Dim cells = GridView1.FooterRow.Cells Dim gvr As GridViewRow = TryCast(TryCast(e.CommandSource, Control).NamingContainer, GridViewRow) 'create the inventory context Dim ctx As New teckEntities() If e.CommandName = ("Insert") Then 'code removed for brevity ElseIf e.CommandName = "DeleteItem" Then 'coderemoved for brevity ElseIf e.CommandName = "Update" Then Dim inventoryUpdate As New inventory() inventoryUpdate.Id = Convert.ToInt32(DirectCast(gvr.Cells(2).FindControl("lblEditId"), Label).Text) inventoryUpdate.ProductId = Convert.ToInt32(DirectCast(gvr.Cells(3).FindControl("tbProdId"), TextBox).Text) inventoryUpdate.Quantity = Convert.ToInt32(DirectCast(gvr.Cells(4).FindControl("tbQuantity"), TextBox).Text) inventoryUpdate.Location = Convert.ToString(DirectCast(gvr.Cells(1).FindControl("tbLocation"), TextBox).Text) ctx.inventories.Attach(inventoryUpdate) ctx.ObjectStateManager.GetObjectStateEntry(inventoryUpdate).SetModified() ctx.SaveChanges() ctx.Dispose() End IfEnd Sub\[/code\]Willing to accept any and all suggestions on changing this methodology, or corrections if I am on the right track.