![dvubb](skins/default/filetype/png.gif)
此主题相关图片如下:2233.png
![dvubb 按此在新窗口浏览图片](UploadFile/2020-11/202011610493631075.png)
要把上表转换成下表要怎么弄
Dim
dtb
As
New
DataTableBuilder("表B")
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("姓名")
Dim
dr1
As
DataRow
=
DataTables("表B").AddNew()
dr1("姓名")
= v
For
Each
dr2
As
DataRow
In
DataTables("表A").Select("姓名
= '" & v & "'")
dr1(dr2("课程"))
= dr2("分数")
Next
Next
MainTable = Tables("表B")