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
//Dictionary<string, string> dictAlarmSql = new Dictionary<string, string>();
//if (dsTmp != null && dsTmp.Tables.Count > 0 && dsTmp.Tables[0].Rows.Count > 0)
//{
// foreach (DataRow dataRow in dsTmp.Tables[0].Rows)
// {
// if (string.IsNullOrEmpty(dataRow["sqltxt"].ToString())) continue;
// dictAlarmSql.Add(dataRow["ALARMID"].ToString(), dataRow["SQLTXT"].ToString());
// }
//}
//报警字典表(优化)
Dictionary<string, string> dictAlarmSql = dsTmp.Tables[0].Rows.Cast<DataRow>().ToDictionary(x => x["ALARMID"].ToString(), x => x["ALARMID"].ToString());