If e.DataCol.name = "SN" Then
Select Case lb.text
Case "2"
Dim rr1 As DataRow = DataTables("assemblyMiddle").SQLFind("item_ID = '" & e.DataRow("SN") & "'")
If rr1 IsNot Nothing Then
Dim rr2s As List(of DataRow) = DataTables("assemblyMiddle").SQLSelect("id_Flag = '" & rr1("id_Flag") & "'")
Dim ndr As DataRow
For Each rr2 As DataRow In rr2s
Dim ndr As DataRow = DataTables("扫描配货明细").AddNew'去掉这个
ndr=DataTables("扫描配货明细").AddNew
msgbox(rr2("item_ID"))-------弹出的结果是对的。
ndr("SN") = rr2("item_ID") -----ndr("SN")怎么不是循环行的值,一直是固定的第一行的值。
Next
End If
End Select
End If
你试试这样行不行?