Foxtable(狐表)用户栏目专家坐堂 → [求助][求助]如何把“任课表”中各班的班任和科任的姓名导入“学籍表”中相应单元格


  共有2932人关注过本帖树形打印复制链接

主题:[求助][求助]如何把“任课表”中各班的班任和科任的姓名导入“学籍表”中相应单元格

帅哥哟,离线,有人找我吗?
大红袍
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2015/8/2 10:37:00 [显示全部帖子]

Dim dlg As new OpenFileDialog
If dlg.ShowDialog = DialogResult.OK Then
    Dim Book As New XLS.Book(dlg.FileName)
    Dim Sheet As XLS.Sheet = Book.Sheets(0)
    Tables("学籍表").StopRedraw()
    Dim nms() As String = {"正班任","政治科任","数学科任","英语科任","化学科任","语文科任","物理科任"}
    For n As Integer = 1 To Sheet.Rows.Count -1
        Dim bh As String = sheet(n,0).Text
        Dim drs As List(Of DataRow) = DataTables("学籍表").Select("班级 = '" & bh & "'")
        For Each dr As DataRow In drs
            For m As Integer = 0 To nms.Length - 1
                dr(nms(m)) = Sheet(n,m).Value
            Next
        Next
    Next
    Tables("学籍表").ResumeRedraw()
End If

 回到顶部