Dim dic As new Dictionary(of String,String)
For Each dr As DataRow In DataTables("表A").datarows
If dic.ContainsKey(dr("日期"))=False AndAlso dic.ContainsValue (dr("姓名"))=False Then
Dim drList As List(of DataRow)=DataTables("表A").Select("日期='" & dr("日期") & "' and 姓名='" & dr("姓名") & "'" )
If drList IsNot Nothing Then
For i As Integer=0 To drList.count-1
If i= 0 Then
drList(i)("考勤")=1
Else
drList(i)("考勤")=0
End If
Next
End If
dic.Add(dr("日期"),dr("姓名"))
End If
Next