Foxtable(狐表)用户栏目专家坐堂 → [求助]告诉导入为什么不能导入时间跟小数?


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

主题:[求助]告诉导入为什么不能导入时间跟小数?

帅哥,在线噢!
有点蓝
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:110655 积分:563189 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2019/6/5 10:34:00 [显示全部帖子]

比如:

Dim s1 As new List(of String)
For Each r As Col In Tables("SubjectList").Cols
    s1.Add(r.Name)
Next
Dim Book As New XLS.Book("c:\test\订单.xls")
Dim Sheet As XLS.Sheet = Book.Sheets(0)
Dim dict As new Dictionary(of String,Integer)
Tables("订单").StopRedraw()

For m As Integer = 0 To Sheet.Cols.Count - 1
    If s1.Contains(Sheet(0,m)) Then
        dict.add(Sheet(0,m),m)
    End If
Next

'注意下面的循环变量从1开始,而不是从0开始,因为Excel表的第一行是标题
For n As Integer = 1 To Sheet.Rows.Count -1
    Dim r As Row = Tables("订单").AddNew()
    For Each key As String In dict.Keys
        r(key) = Sheet(n,dict(m1)).Value
    Next
Next
Tables("订单").ResumeRedraw()

 回到顶部