Dim t As Table = Tables("表A")
For i As Integer = t.TopPosition To t.BottomPosition
Dim dr1 As Row = t.Rows(i)
Dim dr2 As DataRow = DataTables("表B").Find("编码 = '" & dr1("编码") & "' and 品名 = '" & dr1("品名") & "' and 规格 = '" & dr1("规格") & "' and 备注 = '" & dr1("备注") & "'")
If dr2 IsNot Nothing Then
For Each c As Col In Tables("表b").Cols
If c.name.StartsWith("NO") Then
Dim nr As Row = Tables("表D").addnew
nr("编码") = dr2("编码")
nr("品名") = dr2("品名")
nr("规格") = dr2("规格")
nr("备注") = dr2("备注")
nr("nox") = c.name
nr("no") = dr2(c.name)
End If
Next
End If
Next