wofird
2015-12-29 14:33
采纳率: 100%
浏览 1.3k
已采纳

添加考试问题,请问这么写可以么?如果不用gridview呢

QuestionId = Convert.ToInt32(gvAddQuestions.DataKeys[e.RowIndex].Value.ToString()); string QuestionName = ((TextBox)gvAddQuestions.Rows[e.RowIndex].Cells[2].Controls[0]).Text.Trim(); string SubjectName = ((TextBox)gvAddQuestions.Rows[e.RowIndex].Cells[3].Controls[0]).Text.Trim(); string SubjectType = ((TextBox)gvAddQuestions.Rows[e.RowIndex].Cells[4].Controls[0]).Text.Trim(); string Answer = ((TextBox)gvAddQuestions.Rows[e.RowIndex].Cells[5].Controls[0]).Text.Trim(); int QuestionScore = Convert.ToInt32(((TextBox)gvAddQuestions.Rows[e.RowIndex].Cells[6].Controls[0]).Text.Trim( )); string AnswerA = ((TextBox)gvAddQuestions.Rows[e.RowIndex].Cells[7].Controls[0]).Text.Trim(); string AnswerB = ((TextBox)gvAddQuestions.Rows[e.RowIndex].Cells[8].Controls[0]).Text.Trim(); string AnswerC = ((TextBox)gvAddQuestions.Rows[e.RowIndex].Cells[9].Controls[0]).Text.Trim(); string AnswerD = ((TextBox)gvAddQuestions.Rows[e.RowIndex].Cells[10].Controls[0]).Text.Trim(); string DetailedAnswers = ((TextBox)gvAddQuestions.Rows[e.RowIndex].Cells[11].Controls[0]).Text.Trim(); bool flag = false; flag = SubjectOperator.UpdateQuestions(QuestionId, QuestionName, SubjectName, SubjectType, Answer, QuestionScore, AnswerA, AnswerB, AnswerC, AnswerD, DetailedAnswers); if (flag) { gvAddQuestions.EditIndex = -1; init(); }

  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

2条回答 默认 最新

相关推荐 更多相似问题