If e.DataCol.Name = "销售单号" Then
Dim cmd As New SQLCommand
Dim dt As DataTable
Dim dr As DataRow = e.DataRow
cmd.C
cmd.CommandText = "SELECT * From {销售订单明细} Where [销售单号] = \'" & dr("销售单号") & "\'"
dt = cmd.ExecuteReader
If dt.DataRows.Count > 0 Then
Dim count As Integer = e.DataTable.compute("count(_Identify", "[销售单号] = \'" & dr("销售单号") & "\'")
dr("提货机型") = dt.DataRows(0)("提货机型")
dr("数量") = dt.DataRows(0)("数量")
For i As Integer = 1 To dt.DataRows.Count - count
Dim r1 As Row = Tables("提货明细").addnew
r1("提货机型") = dt.DataRows(i)("提货机型")
r1("数量") = dt.DataRows(i)("数量")
Next
Else
dr("提货机型") = Nothing
dr("数量") = Nothing
End If
End If