Dim dr As DataRow = e.DataRow
Dim pr As DataRow
Dim tr As DataRow
If dr("客户名称") IsNot Nothing AndAlso dr("收款日期") IsNot Nothing Then
Dim filter As String =" 客户名称= '" & dr("客户名称") & "'"
pr = DataTables("客户一览表").Find(filter)
tr = DataTables("收款明细表").Find(filter)
If pr IsNot Nothing Then
Dim val As Integer
Dim cmd As New SQLCommand
cmd.CommandText = "Select Sum(收款总额) Fr om {收款明细表} Where year(收款日期) = '" & Date.today.year & "'"
val = cmd.ExecuteScalar()
pr("本期发生_已收货款")=val
MessageBox.show(pr("本期发生_已收货款"))
End If
End If
提示信息:至少一个参数未指定。
[此贴子已经被作者于2015/9/5 17:52:24编辑过]