C# 计算

2021-05-15 17:27

阅读:389

标签:put   color   lis   item   子集   求和   var   name   vol   

1.Datatable、DataRow[]、List 、List子集合、 某列求和

DataTable dt = new DataTable();
var sum1 = dt.Compute("SUM(Volume)", "");

DataRow[] drList = dt.Select("Name=‘AAA‘");
var sum2 = drList.Sum(x => x.Fielddecimal>("Volume"));

var tJlbList = new List();
var sum3 = tJlbList.Sum(o => o.FBcfs);

var sum4 = tJlbList.SelectMany(x => x.TJlb_P_Items).Sum(o => o.FBcfs);

 

C# 计算

标签:put   color   lis   item   子集   求和   var   name   vol   

原文地址:https://www.cnblogs.com/sky-gfan/p/14700331.html


评论


亲,登录后才可以留言!