object[][] objs = new Object[ds.Tables["cstable"].Rows.Count][];
for(int jj = 0; jj < ds.Tables["cstable"].Rows.Count; jj++)
{
DataRow dr = ds.Tables["cstable"].Rows[jj];
objs[jj] = dr.ItemArray;
}
for(int jj = 0; jj < ds.Tables["cstable"].Rows.Count; jj++)
{
DataRow dr = ds.Tables["cstable"].Rows[jj];
objs[jj] = dr.ItemArray;
}
for(int i=0;i<2;i++)
{
foreach(int j=0;j<ds.Tables["cstable"].Rows.Count;j++)
{
if(i==0)
objs[i][j] = ds.Tables["cstable"].Rows[j]["ClassID"];
if(i==1)
objs[i][j] = ds.Tables["cstable"].Rows[j]["ClassName"];
}
}
不知道你是不是这个意思
this.DropDownList1.DataTextField="classname";
this.DropDownList1.DataValueField="classid";
this.DropDownList1.DataSource=Application["kfist"];
这样来绑定到DropDownList吗?怎么在二维数组中怎么去找这个classname哦