Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/linq/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Vb.net 使用LINQ对数据表列求和_Vb.net_Linq - Fatal编程技术网

Vb.net 使用LINQ对数据表列求和

Vb.net 使用LINQ对数据表列求和,vb.net,linq,Vb.net,Linq,我想在linq查询中添加另一个参数(另一个“andalso”语句),用于对CleanedEquipment列求和。因为这些记录不是唯一的。 因此,为了做到这一点,我有另一列“Spcall”,所以我需要对它进行不同的查询,我如何才能做到这一点?(在网上找不到答案)。 我的数据表(dt)如下所示: 这对你有帮助吗?我相信我会有帮助的.这正是我的问题.谢谢.可能是重复的 sumAll_SalesMoney = dt.AsEnumerable() _ .Where(Funct

我想在linq查询中添加另一个参数(另一个“andalso”语句),用于对CleanedEquipment列求和。因为这些记录不是唯一的。 因此,为了做到这一点,我有另一列“Spcall”,所以我需要对它进行不同的查询,我如何才能做到这一点?(在网上找不到答案)。 我的数据表(dt)如下所示:


这对你有帮助吗?我相信我会有帮助的.这正是我的问题.谢谢.可能是重复的
  sumAll_SalesMoney = dt.AsEnumerable() _
           .Where(Function(x) x.Field(Of String)("BillingStatus") = "close" _
                   AndAlso x.Field(Of Integer?)("BillingYear") = currentYear) _
           .Sum(Function(x) x.Field(Of Integer?)("CleanedEquipment"))