SQL法:
Dim dt1,dt2,dt3 As DataTable
Dim sql1,sql2,sql3 As String
dt1 = DataTables("窗口2_Table1")
sql1 = "SELECT 人员 as AB都有 ,'' as A有B无,'' as A无B有 FROM {表A} WHERE 人员 IN (SELECT 人员 FROM {表B})"
sql2 = "SELECT 人员 as A有B无 FROM {表A} WHERE 人员 Not IN (SELECT 人员 FROM {表B})"
sql3 = "SELECT 人员 as A无B有 FROM {表B} WHERE 人员 Not IN (SELECT 人员 FROM {表A})"
Dim cmd2,cmd3 As New SQLCommand
cmd2.CommandText = sql2
dt2 = cmd2.ExecuteReader()
cmd3.CommandText = sql3
dt3 = cmd3.ExecuteReader()
dt1.Fill(sql1,"",True)
Dim f As New Filler
f.SourceTable = dt2
f.DataTable = dt1
f.Append = False
f.Fill() '
f = New Filler
f.SourceTable = dt3
f.DataTable = dt1
f.Append = False
f.Fill() '