Rss & SiteMap

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

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

标题:[求助]部分字段的数据填充问题

1楼
248610381 发表于:2011/12/5 13:43:00
我有表A,列A1、A2、A3 和表B,列B1、B2、B3,现在要将A1、A2 填充到B1、B2中,不用数据字典,用代码怎么样实现?
2楼
狐狸爸爸 发表于:2011/12/5 13:58:00

可以看看这个:

http://www.foxtable.com/help/topics/1533.htm

 

还有这个:

http://www.foxtable.com/help/topics/0680.htm

 

[此贴子已经被作者于2011-12-5 13:59:08编辑过]
3楼
狐狸爸爸 发表于:2011/12/5 14:33:00

看看这里的ExecuteReader方法:

 

http://www.foxtable.com/help/topics/0696.htm

 

4楼
狐狸爸爸 发表于:2011/12/5 14:36:00
Dim cmd As New SQLCommand
Dim dt As DataTable
cmd.Connection Name = "数据源名称"
cmd.CommandText = "SELECT * From {表A} Where 条件语句"
dt = cmd.ExecuteReader()
Dim Cols1() As String = {"来源列一","来源列二","来源列三"}
Dim Cols2() As String = {"接收列一","接收列二","接收列三"}
For Each dr1 As DataRow In dt.DataRows
    Dim dr2 As DataRow = DataTables("表B").AddNew()
    For i As Integer = 0 To Cols1.Length -1
        dr2(Cols2(i)) = dr1(Cols1(i))
    Next
Next
[此贴子已经被作者于2011-12-5 14:36:32编辑过]
共5 条记录, 每页显示 10 条, 页签: [1]

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

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