Rss & SiteMap

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

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

标题:建议:Filler能否加个排序的参数?

1楼
yangming 发表于:2009/5/17 9:08:00
在使用Filler的过程中,发现填充过去的数据并没有按原有的行顺序排序,建议加个排序参数,默认是原顺序.请贺老师考虑一下.
2楼
mr725 发表于:2009/5/17 15:40:00

支持!~

3楼
狐狸爸爸 发表于:2009/5/18 7:44:00

这是多余的,表本来就是Sort属性,过去之后,你想怎么排序都行。
如果你喜欢的话,可以不用Filler,自己写一段简单的代码:

Dim Name1 As New String{"来源列1","来源列2"}
Dim Name2 As New String{"接收列1","接收列2"}
For Each dr1 As DataRow = DataTables("来源表").Select(条件表达式,排序)
    Dim dr2 = DataTables("接收表").AddNew()
    For i As integer = 0 To Names.Length - 1

       dr2(Names2(i)) = dr1(Names1(i))
    Next

Next

[此贴子已经被作者于2009-5-18 7:44:22编辑过]
4楼
yangming 发表于:2009/5/18 9:20:00
哦?我昨天是用Filler在本表中填充时发现这个排序的问题的,比如,我想将本表的第一列数据填充到第三列时,发现填充过去的数据顺序和第一列不同,呵呵这样就无法自己再排序了
5楼
yangming 发表于:2009/5/18 13:20:00
三楼的代码出错了
6楼
yangming 发表于:2009/5/18 13:42:00

这样才对,只是,如果我不想在表B中新增行,又如何做呢?


Dim Name1() As String ={"第一列","第二列"}
Dim Name2() As String ={"第三列","第四列"}
For Each dr1 As DataRow In DataTables("表A").Select("[第一列]> 0","_Identify")
    Dim dr2 As DataRow = DataTables("表B").AddNew()
    For i As integer = 0 To Name1.Length - 1
       dr2(Name2(i)) = dr1(Name1(i))
    Next

Next

[此贴子已经被作者于2009-5-18 13:52:17编辑过]
7楼
狐狸爸爸 发表于:2009/5/18 15:30:00
Dim Name1() As String ={"第一列","第二列"}
Dim Name2() As String ={"第三列","第四列"}
Dim n As integer
For Each dr1 As DataRow In DataTables("表A").Select("[第一列]> 0","_Identify")
    Dim dr2 As DataRow = DataTables("表B").DataRows(n)
    For i As integer = 0 To Name1.Length - 1
       dr2(Name2(i)) = dr1(Name1(i))
    Next
    n = n +1

Next

8楼
yangming 发表于:2009/5/18 15:38:00
谢谢贺老师,这样我就可以同表中填充列了,呵呵,只要改个接收表就可以了

Dim Name1() As String ={"第一列","第二列"}
Dim Name2() As String ={"第三列","第四列"}
Dim n As integer
For Each dr1 As DataRow In DataTables("表A").Select("[第一列]> 0","_Identify")
    Dim dr2 As DataRow = DataTables("表A").DataRows(n)
    For i As integer = 0 To Name1.Length - 1
       dr2(Name2(i)) = dr1(Name1(i))
    Next
    n = n +1

Next

[此贴子已经被作者于2009-5-18 15:38:48编辑过]
共8 条记录, 每页显示 10 条, 页签: [1]

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

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