下面二个循环去掉任何一个都正常,二个都在就出错:a child row was mutilple parents.
Dim dt1 As DataTable = DataTables("凭证")
Dim dt2 As DataTable = DataTables("凭证明细")
Dim Customers As List(Of String)
Customers = dt1.GetUniqueValues("", "凭证类别")
With Tables("凭证")
For Each Customer As String In Customers
Dim r As Row = .Addnew()
r("凭证类别") = Customer
r("凭证ID") = "合计"
Next
End With
With Tables("凭证明细")
For Each Customer As String In Customers
Dim r2 As Row = .Addnew()
r2("凭证类别") = Customer
r2("凭证ID") = "合计"
Next
End With