static void Main(string[] args) { string[,] strArray = new string[10, 10]; DataTable table = new DataTable("Poss"); for (int i = 0; i < 10; ++i) { //添加列 table.Columns.Add(i.ToString()); } for (int i = 0; i < 10; ++i) { //构造行 object[] obj = new Object[10]; for (int j = 0; j < 10; ++j) { strArray[i, j] = "Poss"; obj[j] = strArray[i, j]; } table.Rows.Add(obj); } //成功构造表,添加表 DataSet set = new DataSet(); set.Tables.Add(table); }