类似代码,不会做就请上传例子。
For Each dr As DataRow In DataTables("表A").Select("订单号 = '" & 1 & "'") For Each cdr As DataRow In DataTables("表B").Select("订单号 = '" & dr("产品 ") & "'") Dim ndr As DataRow = DataTables("表C").AddNew ndr("产品") = cdr("产品") NextNext