这是我的代码:
for (i = j; i <= e.curpos; i++)
{
Question q = e.questions[i];-- here exception is occuring
// display details of question
dr = dts.NewRow();
dr["no"] = i+1;
dr["enterquestion"] = q.enterquestion;
dr["optiona"] = q.optiona;
dr["optionb"] = q.optionb;
dr["optionc"] = q.optionc;
dr["optiond"] = q.optiond;
dts.Rows.Add(dr);
}
循环完成后, Question q = e.questions[i]
正在发生异常
答案 0 :(得分:0)
错误是e.curpos等于或大于e.questions.length,或j小于0.您需要使用断点或写入控制台日志才能看到哪个值不正确。