这段代码,没有对应的列,自然会报错。
If e.DataCol.Name = "已开piao" AndAlso e.DataRow.IsNull("出库单编号明细") = False Then
Dim dr As DataRow = DataTables("已开fa piao").Find("出库单编号明细 = '" & e.DataRow("出库单编号明细") & "'")
If e.DataRow(e.DataCol) = True Then
If dr Is Nothing Then
dr = DataTables("已开fa piao").AddNew
For Each dc As DataCol In DataTables("出库明细").DataCols
If DataTables("已开fa piao").DataCols.Contains(dc.Name) Then
dr(dc.Name) = e.DataRow(dc.Name)
End If
Next
End If
Else
If dr IsNot Nothing Then
dr.Delete
End If
End If
End If