Foxtable(狐表)用户栏目专家坐堂 → [求助]集合


  共有8811人关注过本帖树形打印复制链接

主题:[求助]集合

帅哥哟,离线,有人找我吗?
lin_hailun
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:狐神 帖子:6708 积分:34304 威望:0 精华:11 注册:2012/8/18 23:10:00
  发帖心情 Post By:2012/12/13 10:46:00 [显示全部帖子]

 简单的做法是,使用查询表联合两个表,然后获取。

Dim cmd As New SQLCommand
cmd.CommandText = "select a.第一列, a.第二列, a.第三列 from {表A}, {表B}"
Dim dt As DataTable = cmd.ExecuteReader
Dim ary As List(Of String()) = dt.GetUniqueValues("", "第一列", "第二列", "第三列")
msgbox(ary.count)
[此贴子已经被作者于2012-12-13 10:53:23编辑过]

 回到顶部
帅哥哟,离线,有人找我吗?
lin_hailun
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:狐神 帖子:6708 积分:34304 威望:0 精华:11 注册:2012/8/18 23:10:00
  发帖心情 Post By:2012/12/13 11:30:00 [显示全部帖子]

Dim Ary1s As List(Of String())  = DataTables("冷轧物流").GetUniqueValues("[熔铸编号] IS NOT NULL", "品种","合金","保税")
Dim Ary2s As List(Of String())  = DataTables("冷轧盘点表").GetUniqueValues("[熔铸编号] IS NOT NULL", "品种","合金","保税")

Dim Ary3s As List(Of String())  = DataTables("冷轧物流").GetUniqueValues("[熔铸编号] IS NOT NULL", "品种","合金","保税")

For Each Ary2 As String() In Ary2s
    For Each Ary1 As String() In Ary1s
        For i As Integer = 0 To Ary1.Length
            If Ary1(i) <> Ary2(i) Then
                Ary3s.Add(Ary2)
                Exit For
            End If
        Next
    Next
Next

 回到顶部