Rss & SiteMap

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

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

标题:数据填充如何填入指定文本或数字

1楼
netfox168 发表于:2011/12/6 0:15:00

有这样一段代码:

 

Dim f1 As New Filler

f1.SourceTable = DataTables("来源表")

f1.SourceCols = "字段1,字段2,字段3,字段4"

f1.DataTable = DataTables("目标表")

f1.DataCols = "字段1,字段2,字段3,字段4"

f1.ExcludeNullValue = True

f1.Fill()

 

假设我想将“来源表”中的“字段4” 用某固定“文本”或“数字”替代,填充行数和其他字段一样,不知是否可操作?

2楼
狐狸爸爸 发表于:2011/12/6 9:54:00

Dim f1 As New Filler

Dim cnt as integer = DataTables("目标表").DataRows.Count

f1.SourceTable = DataTables("来源表")

f1.SourceCols = "字段1,字段2,字段3"

f1.DataTable = DataTables("目标表")

f1.DataCols = "字段1,字段2,字段3"

f1.ExcludeNullValue = True

f1.Fill()

For i as integer= cnt to DataTables("目标表").DataRows.Count -1

    DataTables("目标表").DataRows(i)("字段4") = "固定的值"

next

共2 条记录, 每页显示 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.