Foxtable(狐表)用户栏目专家坐堂 → [求助]填充不重复行


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

主题:[求助]填充不重复行

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


加好友 发短信
等级:超级版主 帖子:110574 积分:562760 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2017/6/17 14:56:00 [显示全部帖子]

Dim Cols1() As String = {"Chinese_Name","English_Name","Personnel_Classify_Department","Personnel_Classify_Position","Company"}
Dim Cols2() As String = {"Chinese_Name","English_Name","Department","Position","Company"}
Dim lst1 As new List(of DataRow)
Dim lstname As new List(of String)
For Each dr1 As DataRow In DataTables("员工").Select("[Personnel_Classify_Category] =  '间接' And [Status] = 'Onduty'")
    If DataTables("通讯录").Find("Chinese_Name='" & dr1("Chinese_Name") & "'") Is Nothing AndAlso lstname.Contains(dr1("Chinese_Name")) = False
        lst1.Add(dr1)
        lstname.Add(dr1("Chinese_Name"))
    End If
Next

For Each dr As DataRow In lst1
    Dim dr2 As DataRow = DataTables("通讯录").AddNew()
    For i As Integer = 0 To Cols1.Length -1
        dr2(Cols2(i)) = dr(Cols1(i))
    Next
Next

 回到顶部