我弄错了梅斯加 [英] Error Messgar I got it

查看:147
本文介绍了我弄错了梅斯加的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

索引超出范围.必须为非负数并且小于集合的大小.
参数名称:index

Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index

string query = "update Questionnaire_UserAnswers set Comments='" + grdView.Rows[].Cells[1].Controls[0] + "', Marks=" + grdView.Rows[4].Cells[5].Controls[0] + " where Question_ID=" + grdView.Rows[0].Cells[1].Controls[0] + "UserName='" + Request.QueryString["UserName"] + "'";


请纠正此错误


Please Rectify this Error

推荐答案

检查是否未在gridView1.Rows []中为第一个值提供索引:
check once u are not provided index in gridView1.Rows[] at first value:
grdView.Rows[].Cells[1].Controls[0] 


提供行索引


provide row index


好,这意味着您使用的索引器之一超出了数组长度.
请确保:
1-您的grView至少有5行.
2-您的grView至少有6列.
3-您的第2列和第6列中已经至少包含1个控件.
Well,this means that one of the indexer you are using exceeded the array length.
Make sure that:
1- Your grView have at least 5 rows.
2- Your grView has at least 6 columns.
3- Your 2nd and 6th columns already have at least 1 control in it.


这篇关于我弄错了梅斯加的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆