以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  数据填充如何填入指定文本或数字  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=14886)

--  作者: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” 用某固定“文本”或“数字”替代,填充行数和其他字段一样,不知是否可操作?


--  作者:狐狸爸爸
--  发布时间: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