DataTable 统计求和

DataView dvSum = new DataView(dt, string.Format("RKB004='{0}'", selRow["cInvCode"].ToString()), "", DataViewRowState.CurrentRows);
                    sumQty = dvSum.ToTable().AsEnumerable().Sum(p => p.Field<decimal>("RKB012") + p.Field<decimal>("RKB020"));

 

转载于:https://www.cnblogs.com/xust/articles/4031394.html

你可能感兴趣的:(DataTable 统计求和)