Foxtable(狐表)用户栏目专家坐堂 → 两个代码如何合并


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

主题:两个代码如何合并

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


加好友 发短信
等级:管理员 帖子:47497 积分:251403 威望:0 精华:91 注册:2008/6/17 17:14:00
  发帖心情 Post By:2012/9/26 15:21:00 [显示全部帖子]

Dim names1 As List(Of String) = DataTables("一一与一二对比").GetUniqueValues("", "在岗人员对比_一一年")
Dim names2 As List(Of String) = DataTables("一一与一二对比").GetUniqueValues("", "在岗人员对比_一二年")
Dim names3 As New List(Of String)
Dim names4 As New List(Of String)
For Each name As String In names1
    If Not names2.Contains(name) Then
        names3.add(name)
    End If
Next
For Each name As String In names2
    If Not names1.Contains(name) Then
        names4.add(name)
    End If
Next
For i As Integer = 0 To names3.Count - 1
    Tables("一一与一二对比").Rows(i)("增加") = names3(i)
Next
For i As Integer = 0 To names4.Count - 1
    Tables("一一与一二对比").Rows(i)("减少") = names3(i)
Next


 回到顶部