Dim dtb As New DataTableBuilder("表D")
dtb.AddDef("第一列",Gettype(String), 4)
dtb.AddDef("第二列",Gettype(String), 10)
dtb.AddDef("列a_名称",Gettype(String), 10)
dtb.AddDef("列a_内容",Gettype(String), 10)
dtb.AddDef("列b_名称",Gettype(String), 10)
dtb.AddDef("列b_内容",Gettype(String), 10)
dtb.AddDef("列c_名称",Gettype(String), 10)
dtb.AddDef("列c_内容",Gettype(String), 10)
dtb.Build()
Dim kms() As String = {"第三列_a","第四列_a","第五列_a"}
Dim kms2() As String = {"第三列_b","第四列_b","第五列_b"}
Dim kms3() As String = {"第三列_c","第四列_c","第五列_c"}
For Each dr1 As DataRow In DataTables("表C").DataRows
For i As Integer = 0 To kms.Length - 1
Dim dr2 As DataRow = DataTables("表D").AddNew()
dr2("第一列") = dr1("第一列")
dr2("第二列") = dr1("第二列")
'dr2("第六列") = dr1("第六列")
dr2("列a_名称") = kms(i)
dr2("列a_内容") = dr1(kms(i))
dr2("列b_名称") = kms2(i)
dr2("列b_内容") = dr1(kms2(i))
dr2("列c_名称") = kms3(i)
dr2("列c_内容") = dr1(kms3(i))
Next
Next
MainTable = Tables("表D")