大概如此
If e.DataCol.Name = "是否入库" Then
If e.NewValue = True Then
Dim drs As List(of DataRow)
drs= DataTables("订单明细") .Select("订单ID =" & e.DataRow("订单ID"))
If drs.count>0 Then
For Each dr As DataRow In drs
Dim dr1 As DataRow = DataTables("库存数量").Find("商品编号= '" & dr("商品编号") & "'")
If dr1 IsNot Nothing Then
dr1("库存数量")+ = dr("数量")
End If
Next
End If
End If
End If