Foxtable(狐表)用户栏目专家坐堂 → 这样格式数据怎样导入系统中


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

主题:这样格式数据怎样导入系统中

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


加好友 发短信
等级:七尾狐 帖子:1695 积分:10725 威望:0 精华:0 注册:2009/10/25 16:45:00
  发帖心情 Post By:2013/8/2 9:35:00 [显示全部帖子]

bin版老师的不太理解,而且导入不全,这样也可以········ :

 

Dim dlg As New OpenFileDialog
If dlg.ShowDialog = DialogResult.Ok Then
    Dim rs As String = FileSys.ReadAllText(dlg.FileName)

    For i As Integer = 0 To rs.split(chr(10) & chr(13)).length -1
        If rs.split(chr(10) & chr(13))(i).contains("'")

            Dim szh As String = rs.split(chr(10) & chr(13))(i).replace("'","")

            Dim dr As Row = Tables("表A").AddNew
            For j As Integer=0 To Tables("表A").Cols.Count-1
                If j = 0
                    dr(Tables("表A").Cols(j)) = szh.split(",")(j)
                ElseIf j =1 Then
                    dr(Tables("表A").Cols(j)) = "按科目号另外生成"
                Else
                    dr(Tables("表A").Cols(j)) = val(szh.split(",")(j-1))
                End If
            Next
        End If
    Next
End If
MessageBox.show("完成!")


 回到顶部