昨天下午钻了两个小时的牛角尖才悟出来,惭愧。一直以为一维数组可以绑定到dropdownlist,二维数组应该也可以,查了资料才明白数据源必须是实现 System.Collections.IEnumerable 接口(如 System.Data.DataView、System.Collections.ArrayList 和 System.Collections.Hashtable)的对象,不好使用数组. 所以要转换一下才能绑定,把二给数组转换为DataTable或者使用item.insert()方法添加; 把二组数组转换为DataTable进行绑定: DataTable dt = new DataTable("tbl"); dt.columns.add("0", Typeof(System.string)); dt.columns.add("1", Typeof(System.string)); DataRow row; for(int i=0; i< aa.length; i++) DropDownList1.DataBind(); 使用item.insert()方法添加: for(int j=0;j<aa.GetLength(0);j++) } 相关文章: