Dim cmd As New SQLCommand
Dim dt As DataTable
cmd.ConnectionName = Mydata
Dim edr As DataRow = e.DataRow
Dim tbl As Table = Tables("销售出库单_明细")
Select Case e.DataCol.name
Case "出货日期","分类"
If edr.IsNull("出货日期") = False AndAlso edr.IsNull("分类") = False Then
cmd.CommandText = "SELECT * From dbo.ufn_xsck('" & edr("分类") & "','" & edr("出货日期") & "')"
dt = cmd.ExecuteReader
If dt.DataRows.count > 0 Then
tbl.StopRedraw
For Each dr As DataRow In dt.DataRows
Dim r As Row = tbl.AddNew()
r("产品编码") = dr("产品编码")
r("品名") = dr("品名")
r("规格") = dr("规格")
r("数量") = dr("数量") - dr("累计出货")
Next
tbl.ResumeRedraw
End If
End If
End Select
如上面的代码是写在主表的datacolchanged事件中的,但有时用户在操作时会出现重复提取两次数据导致明细表中的数据重复,
请问一下是什么情况下才可能导致这种现象(1个月会出现一两次)
谢谢!