日期:2014-05-18 浏览次数:20472 次
DataTable dt = new DataTable(); dt.Columns.Add(new DataColumn("名称")); dt.Columns.Add(new DataColumn("拼音")); dt.Columns.Add(new DataColumn("生日")); dt.Columns.Add(new DataColumn("婚否")); ArrayList al = new ArrayList(); foreach (string s in al) { string[] temp = s.Split(new char[] { ',' }); DataRow dr = dt.NewRow(); for (int i = 0; i < temp.Length; i++) dr[i] = temp[i]; dt.Rows.Add(dr); } this.DataGrid1.DataSource = dt; this.DataGrid1.DataBind();
------解决方案--------------------