本文介绍了运算符'+'不能应用于'string []'和'int'类型的操作数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
protected void ddlCircle_SelectedIndexChanged(对象发件人,EventArgs e)
{
ArrayList list = new ArrayList();
ShadingAnalysisDataSetTableAdapters.tbl_CadEngineersTeamTableAdapter cd;
cd = new ShadingAnalysisDataSetTableAdapters.tbl_CadEngineersTeamTableAdapter();
DataTable dt = new DataTable();
dt = cd.GetAvailableData(ddlCircle.SelectedValue);
int x;
x = dt.Rows.Count;
String [] a;
字符串 [] b = { 团队};
for ( int i = 1 ; i < = x; i ++)
{
a = b + i; // 此处出现错误
}
}
解决方案
protected void ddlCircle_SelectedIndexChanged(object sender, EventArgs e) { ArrayList list = new ArrayList(); ShadingAnalysisDataSetTableAdapters.tbl_CadEngineersTeamTableAdapter cd; cd = new ShadingAnalysisDataSetTableAdapters.tbl_CadEngineersTeamTableAdapter(); DataTable dt = new DataTable(); dt = cd.GetAvailableData(ddlCircle.SelectedValue); int x; x = dt.Rows.Count; String [] a; String [] b = { "Team" }; for (int i = 1; i <= x; i++) { a = b + i; // error popup here } }
解决方案
这篇关于运算符'+'不能应用于'string []'和'int'类型的操作数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!