There might be few reasons of your issue, for example
row.Cells[1]
does not contain student id or a value passed to the
Convert.ToInt16()
method exceeds
Int16.MaxValue[
^].
I'd try to get student id this way:
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
int index = Convert.ToInt32(e.CommandArgument);
GridViewRow row = ContactsGridView.Rows[index];
studu = Convert.ToInt32(row.Cells[1].Text);
}
More at MSDN:
GridView.RowCommand Event (System.Web.UI.WebControls)[
^]