Dim b As New SQLGroupTableBuilder("课程表","灵川中心表一")
b.C
b.FIlter = DataTables("灵川中心表一").loadFIlter
If Tables("灵川中心表一").FIlter > "" Then
b.FIlter = IIF(b.FIlter > "", b.FIlter & " and ","") & Tables("灵川中心表一").FIlter
End If
b.Groups.AddDef("学校")
b.Groups.AddDef("年级")
b.Groups.AddDef("班级")
b.Groups.AddDef("节序")
b.build()
MainTable = Tables("课程表")
Dim sr() As String = {"一","二","三","四","五"}
For Each s As String In sr
DataTables("课程表").DataCols.Add("星期_" & s,Gettype(String),16)
Next
For Each dr1 As DataRow In DataTables("灵川中心表一").DataRows
Dim dr2 As DataRow = DataTables("课程表").find("学校=\'" & dr1("学校") & "\' and 年级=\'" & dr1("年级") & "\' and 班级=\'" & dr1("班级") & "\'and 节序=\'" & dr1("节序") & "\'")
If dr2 Is Nothing Then
dr2 = DataTables("课程表").AddNew()
End If
dr2("星期_一") = dr2("星期_一") + dr1("星期_一")
dr2("星期_二") = dr1("星期_二") + dr2("星期_二")
dr2("星期_三") = dr1("星期_三") + dr2("星期_三")
dr2("星期_四") = dr1("星期_四") + dr2("星期_四")
dr2("星期_五") = dr1("星期_五") + dr2("星期_五")
Next