以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- 列数据变成行数据的问题 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=70514) |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-- 作者:阿福 -- 发布时间:2015/6/23 16:45:00 -- 列数据变成行数据的问题 请问一下,我想把“原图”的效果变成“效果图1”,但执行“maintablechanged”之后,却变成“效果图2”。尝试调试程序,结果只执行到 MessageBox.show(6) 恳求各位大神帮我解救以下,最好可以完善以下的程序! (发帖时发现,没办法发上图片只好用插上表格表示) 原图
效果图1
效果图2
If MainTable.Name ="表B" Then DataTables("表B").DeleteFor("") MessageBox.show(1) Dim a As List(of String) = DataTables("表A").GetValues("第一列") MessageBox.show(2) For Each b As String In a MessageBox.show(3) Dim dc As DataRow = DataTables("表B").AddNew() MessageBox.show(4) dc("第一列") = b MessageBox.show(5) Dim drs As List(of DataRow) = DataTables("表A").Select("[第一列] = \'b\'","第二列") MessageBox.show(6) For i As Integer = 0 To drs.Count -1 MessageBox.show(7) Dim s() As String = {"第二列","第三列","第四列","第五列","第六列","第七列"} MessageBox.show(8) Dim dt As DataRow = DataTables("表B").find("[第一列] = \'" & drs(i)("第一列") & "\'") MessageBox.show(9) dt(s(i)) = drs(i)("第一列") MessageBox.show(10) Next Next End If |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-- 作者:大红袍 -- 发布时间:2015/6/23 17:11:00 -- If MainTable.Name ="表B" Then For Each b As String In a Dim dc As DataRow = DataTables("表B").AddNew() dc("第一列") = b Dim drs As List(of DataRow) = DataTables("表A").Select("[第一列] = \'" & b & "\'","第二列") For i As Integer = 0 To drs.Count -1 Dim s() As String = {"第二列","第三列","第四列","第五列","第六列","第七列"} Dim dt As DataRow = DataTables("表B").find("[第一列] = \'" & drs(i)("第一列") & "\'") |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-- 作者:阿福 -- 发布时间:2015/6/23 17:25:00 -- 可以啦,十分感谢! |