以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  有关复制到新表的问题  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=24154)

--  作者:SMIL
--  发布时间:2012/10/5 19:58:00
--  有关复制到新表的问题

以下代码是把cg2中[C111]不为空的行复制到cg3中,但怎么就实现不了,请教!

 

Dim Cols1() As String = {"C1","C2","C3"}
Dim Cols2() As String = {"C1","C2","C3"}
For Each dr1 As DataRow In DataTables("cg2").Select("[C111] Is Null")

Dim dr2 As DataRow = DataTables("cg3").AddNew()

     For i As Integer = 0 To Cols1.Length -1

     dr2(Cols2(i)) = dr1(Cols1(i))

     Next

Next

MainTable = Tables("cg3")


--  作者:万通
--  发布时间:2012/10/5 20:25:00
--  

 

[此贴子已经被作者于2012-10-5 22:10:24编辑过]

--  作者:czy
--  发布时间:2012/10/5 20:40:00
--  
语句错误了,判断不为空应该是 is not null