Hey there,
Its quite obvious in your code, you have declared an
SqlCommand
variable
SqlCommand mySqlCommand;
but used it without creating its object here:
mySqlCommand.Parameters.Add("@UserID", SqlDbType.Int).Value = Convert.ToInt32(GrdFileApprove.DataKeys[row.RowIndex]["UserID"]);
and you are creating an object of
SqlCommand
here:
SqlCommand cmd = new SqlCommand("approved", mySQLconnection);
but never used it.
Change the above line to:
mySqlCommand = new SqlCommand("approved", mySQLconnection);
Let me know if it helps,
Azee...