A few notes for you:
(1) Always check for nulls when referencing a Session object.
if(Session["table"] != null){
}
(2)Always check for the Rows count before accessing the grid’s row collection.
if(Admin_Grid.Rows.Count > 0){
}
(3) If you want to get the text vale of a Label, then you should use the .Text after casting the object to a Label.
string someVariableName = ((Label)(row.Cells[1].Controls[0])).Text;
(4)Verify that you your DataTable contains the name of the field that you are trying to access. In your case, make sure that the
APCUserID
field name
exist in your DataTable otherwise it will throws an error. If you are unsure about the field names, then you can alternatively reference them using indeces. For example:
dt.Rows[row.DataItemIndex][0] = ((Label)(row.Cells[1].Controls[0])).Text;
The downside of using index in referencing a column is that if the sequence of column changes, then your data/logic will be messed up.