Access DataKeyField value in the update command

 Dim metadataid As Integer = CInt(Gridname.DataKeys(e.Item.ItemIndex))