For Each dr As DataRow In DataTables(bm).DataRows
Dim srs As New List(of DataRow)
srs = DataTables("Test").SQLSelect("年月 = '" & dr("年月") & "' and 仓库名称 = '" & dr("仓库名称") & "' and 存货名称 = '" & dr("存货名称") & "'")
If srs.Count>1 Then
Dim sum As Double = Math.Round(DataTables("Test").Compute("Sum(成本金额)","年月 = '" & dr("年月") & "' and 仓库名称 = '" & dr("仓库名称") & "' and 存货名称 = '" & dr("存货名称") & "'"),4)
For Each sr As DataRow In srs
sr("调拨差异") = Math.Round(sr("调拨差异") + Math.Round(dr("差异金额") * (sr("成本金额")/sum), 2),2)
sr("实际成本") = sr("成本金额") + sr("调拨差异")
Next
DataTables("Test").SQLUpdate(srs)
End If
Next
传入的表格格式数据流(TDS)远程过程调用(RPC)协议流不正确。参数 3 (""): 提供的值不是数据类型 float 的有效实例。请检查源数据中的无效值。例如,小数位数大于精度的数值类型的数据即为无效值。
老师,这个错误怎么原因是什么呢?我用了 Math.Round去除了小数位,也不行,求解