DataTable dt = new DataTable();
dt.Columns.Add("姓名");
dt.Columns.Add("学号");
dt.Rows.Add(new object[] { "小张", "0001" });
dt.Rows.Add(new object[] { "小王", "0002" });
dt.Rows.Add(new object[] { "小李", "0003" }); dt.Rows.Cast<DataRow>().ToDictionary(x => x[0].ToString(), x => x[1].ToString());