未将对象引用设置到对象的实例。
未将对象引用设置到对象的实例。
说明: 执行当前 Web 请求期间,出现未经处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。
异常详细信息: System.NullReferenceException: 未将对象引用设置到对象的实例。
源错误:
行 100: {
行 101: string stuID = GridView1.DataKeys[e.RowIndex].Values[0].ToString(); //取出编辑行的主键值
行 102: string stuName = ((TextBox)GridView1.Rows[e.RowIndex].FindControl("txtName")).Text; //取出修改后的值,有问题的语句 无法实现更新功能。
行 103: string stuSex = ((TextBox)GridView1.Rows[e.RowIndex].FindControl("txtSex")).Text;
行 104: string stuPhone = ((TextBox)GridView1.Rows[e.RowIndex].FindControl("txtPhone")).Text;