Dim dtb As New DataTableBuilder("表B")
dtb.AddDef("学期", Gettype(String), 32)
dtb.AddDef("科目", Gettype(String), 32)
For Each v As String In DataTables("表A").GetValues("姓名")
dtb.AddDef(v, Gettype(Double))
Next
dtb.Build()
For Each v As String In DataTables("表A").GetValues("学期")
For Each dc As DataCol In DataTables("表A").datacols
If dc.name <> "学期" AndAlso dc.name <> "姓名"
Dim dr1 As DataRow = DataTables("表B").AddNew()
dr1("学期") = v
dr1("科目") = dc.name
For Each v2() As String In DataTables("表A").GetValues("姓名|" & dc.name)
dr1(v2(0)) = v2(1)
Next
End If
Next
Next
MainTable = Tables("表B")