Dim ndx As Table = Tables("E1生产发料单_ndx")
Dim detail As Table = Tables("E1生产发料单_detail")
For Each dr As Row In detail.Rows
Dim Colsa() As String = {"usercode"}
Dim filter As String
For i As Integer = 0 To Colsa.Length-1
If filter = "" Then
filter = Colsa(i) & " = '" & dr(Colsa(i)) & "'"
Else
filter =filter & " and " & Colsa(i) & " = '" & dr(Colsa(i)) & "'"
End If
Next
MessageBox.show("提示 " & filter)
Next
在循环第一次时,变量filter会保存一个值,当循环第二次时重新定义变量filter(个人理解filter原有的值就应该清空了而且这个变量在for each 的区间内),为什么上一次循环的变量值,会继续跟踪到第二次循坏