Linq初学用法(3) 从dataTable 取出一列值
程序员文章站
2022-07-04 08:47:12
...
List<string> timeList = (from d in _dt_base.AsEnumerable() select d.Field<string>("gettime")).ToList();
Dictionary<string, DataRow> _dic_base = _dt_base.Rows.Cast<DataRow>().ToDictionary(x => ((DateTime)x["gettime"]).ToString("yyyy-MM-dd"), x =>x);
dataTable 转List 转Dictionary
下一篇: C#之LINQ学习笔记