For Each n As String In DataTables("主表").GetValues("B")
Dim dtb As New DataTableBuilder(n)
Dim dlist As List(of String) = DataTables("主表").GetValues("D","B='" & n & "'")
For Each d As String In dlist
dtb.AddDef(d, Gettype(Integer))
Next
dtb.Build()
For Each d As String In dlist
For Each dr As DataRow In DataTables("主表").Select("B='" & n & "' and D='" & d & "'")
Dim drr As DataRow = DataTables(n).Find(d & " is null")
If drr Is Nothing Then
drr = DataTables(n).AddNew
End If
drr(d)=dr("C")
Next
Next
Next