https://blog.csdn.net/jasonleesjtu/article/details/7555514
int[,] TABLE = new int[,] { { 1, 2, 3 }, { 4, 5, 6 } }; DataTable dt = new DataTable(); for (int i = 0; i < TABLE.GetLength(1); i++) dt.Columns.Add(i.ToString(), typeof(int)); for (int i = 0; i < TABLE.GetLength(0); i++) { DataRow dr = dt.NewRow(); for (int j = 0; j < TABLE.GetLength(1); j++) dr[j] = TABLE[i, j]; dt.Rows.Add(dr); } this.dataGridView1.DataSource = dt;标签:C#,GetLength,++,DataGridView,int,二维,TABLE,dt,dr From: https://www.cnblogs.com/Dongmy/p/17334074.html