Foxtable(狐表)用户栏目专家坐堂 → [原创]


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

主题:[原创]

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


加好友 发短信
等级:婴狐 帖子:3 积分:402 威望:0 精华:0 注册:2020/3/5 13:26:00
[原创]  发帖心情 Post By:2022/12/2 9:25:00 [只看该作者]

                Dim tb As Table = Tables("yuangongxiaoshou")
                Dim dtb As DataTable = DataTables("yuangongxiaoshou")
                Dim kairow As Integer = riqizhi
                Dim dtrows As List(Of DataRow)
                dtrows = DataTables("yuangongxiaoshou").Select("riqi>=" & kairow)
                If dtrows.Count > 0 Then
                    For Each dtrw As DataRow In dtrows
                        dtrw.Delete
                    Next
                End If
                '导入数据
                Dim filname As String = "C:\Users\Administrator\Desktop\" & dizhi
                Dim App As New MSExcel.Application
                Dim Wb As MSExcel.WorkBook = App.WorkBooks.Open(filname)
                Dim Ws As MSExcel.WorkSheet = Wb.WorkSheets(1)
                Dim Rgs As MSExcel.Range = Ws.UsedRange
                Dim hang As Integer = Rgs.Rows.Count
                Wb.Save
                Wb.Close
                App.Quit
                Dim _execl As New ExOpenXml.ExOXExecl()
                _execl.Open(filname, True)'打开
                _execl.AppendToDataTable(DataTables("yuangongxiaoshou").Basetable, , ,0, hang - 1)
                _execl.Dispose()
                tb.ResumeRedraw
                DataTables("yuangongxiaoshou").save()

导入Excel不成功,是哪里的问题


 回到顶部
帅哥哟,离线,有人找我吗?
有点蓝
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:110592 积分:562856 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2022/12/2 9:40:00 [只看该作者]

新建项目做个例子,把"yuangongxiaoshou"表导入新项目,然后把execl文件一起发上来测试

 回到顶部
帅哥哟,离线,有人找我吗?
有点蓝
  3楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:110592 积分:562856 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2022/12/2 9:40:00 [只看该作者]


 回到顶部