Rss & SiteMap

Foxtable(狐表) http://www.foxtable.com

新一代数据库软件,完美融合Access、Foxpro、Excel、vb.net之优势,人人都能掌握的快速软件开发工具!
共2 条记录, 每页显示 10 条, 页签: [1]
[浏览完整版]

标题:批量写入table

1楼
puma 发表于:2024/2/29 9:05:00
我从文件夹里循环获取了信息,一个一个写入table有点慢。
可以先读取数组或者list 一次性写入talbe吗?




Dim t As Table = Tables("测试表")
Dim num(, ) As Integer = {{1, 2, 3} , {4, 5, 6}, {7, 8, 9}}
Dim colName As String
For i As Integer = 0 To 2
    Dim r As Row = t.AddNew()
    For j As Integer = 0 To 2
        If j = 0 Then
            colName = "第一列"
        Else If j = 1 Then
        colName = "第二列"
        Else
            colName = "第三列"
            
        End If 
        r(colName) = num(i, j)
        '        r(j - 1) = num(i, j)
    Next
Next
2楼
有点蓝 发表于:2024/2/29 9:10:00
没看懂这个代码和文件夹有啥关系

其次数组集合也是要遍历,一样是属于一个一个写入
共2 条记录, 每页显示 10 条, 页签: [1]

Copyright © 2000 - 2018 foxtable.com Tel: 4000-810-820 粤ICP备11091905号

Powered By Dvbbs Version 8.3.0
Processed in .01563 s, 2 queries.