定义一函数,输入值为一个二维字符数组([8,2]),返回值为一个字符串变量。
函数功能是对第i维的[i,0][i,1]中的字符串值进行处理。private string SearchLessons(string [,] selectSearchItems)
{
string whereSql="";
for (int i=0;i<selectSearchItems.GetLength(0);i++)
{
if (selectSearchItems[i][0]!="")
whereSql+=selectSearchItems[i][0]+"='"+selectSearchItems[i][1]+"' ";
}
return whereSql;
}
编译时,报selectSearchItems[i][0]有错,出错提示是:
[] 内索引数错误,应为“2”
函数功能是对第i维的[i,0][i,1]中的字符串值进行处理。private string SearchLessons(string [,] selectSearchItems)
{
string whereSql="";
for (int i=0;i<selectSearchItems.GetLength(0);i++)
{
if (selectSearchItems[i][0]!="")
whereSql+=selectSearchItems[i][0]+"='"+selectSearchItems[i][1]+"' ";
}
return whereSql;
}
编译时,报selectSearchItems[i][0]有错,出错提示是:
[] 内索引数错误,应为“2”
解决方案 »
- mvc member ship
- 自定义控件,脚本中获取不到
- 2003转到2005 treeview 的错误问题
- Request.QueryString传值问题 大家帮帮忙
- 连接到SQL2005
- 为什么dxf文件没法访问?
- 为什么我的Image控件里的图片显示不出来呢?(出现一个叉)
- ---- 50 分求助---- Ajax 问题?
- DataGrid中我已经是动态绑定列了,我想在后面动态增加一个链接,点击链接,是window.open的效果
- 如何实现在一个dataset中实现下列功能。
- 一个非常奇怪的现象!!我做网上上传到网上,后台添加,删除的按钮失效!!
- 急!!在线等!我是新手,请各位解决一个问题.EXCEL导入SQL中,如果EXCEL中输入的字段属性与SQL中字段属性不一致,就提示出错,不允许导入.这该
好了,散分。