+ -
当前位置:首页 → 问答吧 → “GridView1.Rows[e.RowIndex].Cells[0].Controls[0]”引发了“System.ArgumentOutOfRangeEx

“GridView1.Rows[e.RowIndex].Cells[0].Controls[0]”引发了“System.ArgumentOutOfRangeEx

时间:2011-12-21

来源:互联网

MCU = new Model.TOA_Sale_Clients_Contacter();
  MCU.Contacter = ((TextBox)(GridView1.Rows[e.RowIndex].Cells[1].Controls[0])).Text.ToString().Trim();
  MCU.Sex = ((TextBox)(GridView1.Rows[e.RowIndex].Cells[2].Controls[0])).Text.ToString().Trim();
  MCU.Fixphone = ((TextBox)(GridView1.Rows[e.RowIndex].Cells[3].Controls[0])).Text.ToString().Trim();
  MCU.MovePhone = ((TextBox)(GridView1.Rows[e.RowIndex].Cells[4].Controls[0])).Text.ToString().Trim();
  MCU.DutyName = ((TextBox)(GridView1.Rows[e.RowIndex].Cells[5].Controls[0])).Text.ToString().Trim();
  MCU.EMail = ((TextBox)(GridView1.Rows[e.RowIndex].Cells[6].Controls[0])).Text.ToString().Trim();
  MCU.ReMark = ((TextBox)(GridView1.Rows[e.RowIndex].Cells[7].Controls[0])).Text.ToString().Trim();
  MCU.AutoID = int.Parse(((TextBox)(GridView1.Rows[e.RowIndex].Cells[0].Controls[0])).Text.ToString().Trim());
  BCU.Update(MCU);

提示这行出错
MCU.AutoID = int.Parse(((TextBox)(GridView1.Rows[e.RowIndex].Cells[0].Controls[0])).Text.ToString().Trim());

“GridView1.Rows[e.RowIndex].Cells[0].Controls[0]”引发了“System.ArgumentOutOfRangeException”类型的异常





作者: xxortlikangchao   发布时间: 2011-12-21

System.ArgumentOutOfRangeException”类型的异常


GridView1没数据引起的吧

作者: yang_ying1983   发布时间: 2011-12-21

相关阅读 更多

热门下载

更多