可以考虑用 hashset
dim rqs as new hashset(of string) ' Dim rqs As List(of String) = dr("过账日期") ----这是导致错误的原因。 Dim rqs As new List(of String)
dim pzs as new hashset(of string) 'Dim pzs As List(of String) = dr("入库凭证号") ----这是导致错误的原因。 Dim pzs As new List(of String)
Dim rq As String = CStr(e.DataRow("过账日期"))
Dim pz As String = e.DataRow("入库凭证号")
' If rqs.Contains(rq) = False Then '判断是否存在当前日期
rqs.Add(rq)
'End If
' If pzs.Contains(pz) = False Then '判断是否存在当前凭证
rqs.Add(pz)
' End If
dr("入库数量") = e.DataTable.Compute("sum(入库数量)",f)
[此贴子已经被作者于2021/8/29 22:26:37编辑过]