参考代码
Dim dtb As New DataTableBuilder("表B")
dtb.AddDef("name", Gettype(String), 32)
For Each v As String In DataTables("表A").GetValues("id")
dtb.AddDef("列" & v, Gettype(String), 32, "", v)
Next
dtb.Build()
For Each v As String In DataTables("表A").GetValues("name")
Dim dr1 As DataRow = DataTables("表B").AddNew()
dr1("name") = v
For Each dr2 As DataRow In DataTables("表A").Select("name = '" & v & "'")
dr1("列" & dr2("id")) = dr2("value")
Next
Next
MainTable = Tables("表B")