关于datatable datarow
DataTable paraval = GetParaVal(DateCondition, strUrl, Page, RowPage, iYearMonthNow, 2);
var query = from t in paraval.AsEnumerable() //datatable 和linq转换
group t by new { t1 = t.Field<string>("InsKind") } into m
select new
{
InsKind = m.Key.t1
};
//循环列表
if (query.ToList().Count > 0)
{
query.ToList().ForEach(q =>
{
DataRow[] drx = paraval.Select("InsKind='" + q.InsKind + "'", "Year desc ,Month desc");//根据InsKind的种类按年和月排序
dt.Rows.Add(drx[0].ItemArray);//取得最近的一笔数据
});
}
DataRow得到的是一行数据