'生成"课时名单"表 Dim ksmd As New DataTableBuilder("课时名单") ksmd.AddDef("姓名", GetType(String), 15) ksmd.AddDef("星期", GetType(String), 15) ksmd.AddDef("计分", GetType(Integer)) ksmd.Build() '生成"课时名单"数据 Dim Values() As String Dim n As Integer = Tables("课程表").rows.count Dim n1 As Integer for Each dc as Datacol in DataTables("课程表").Datacols if dc.name <> "班级" Then n1 = n1 +1 dim f As New Filler f.SourceTable = DataTables("课程表") '指定数据来源 f.SourceCols = dc.name '指定数据来源列 f.DataTable = DataTables("课时名单") '指定数据接收表 f.DataCols = "姓名" '指定数据接收列 f.Distinct = false f.Fill() '填充数据 Values = dc.name.split("_") For i As integer = (n*n1)-n to Tables("课时名单").rows.count -1 Dim dr As DataRow = DataTables("表A").Find("星期 = '" & Values(0) & "'") Tables("课时名单").Rows(i)("星期") = Values(0) Tables("课时名单").Rows(i)("计分") = dr("正课") Next end if Next
|