DataTable dt = new DataTable();
DataTable newDataTable = new DataTable();
//添加dt中的数据 到 newDataTable 中
foreach (DataRow dr in dt.Rows) { newDataTable.Rows.Add(dr.ItemArray); }
Dictionary<string, List<Data>> tabDatas = new Dictionary<string, List<Data>>();
for (int i = 0; i < datas[0].Count; i++)
{ List<Data> data1 = new List<Data>(); for (int j = 0; j < datas.Count; j++) { data1.Add(datas[j][i]); } tabDatas[datas[0][i].Time.ToString()] = data1; //datas[0][i].Time.ToString()为key ,不重复,当key 重复时,将value值覆盖之前的value,不会报错 }