现九月份(表名:Month9)和十月份(表名:Month10)各有一份民工出勤表,再有一个统计出勤表(表名:sdt),Sdt的姓名是从前两个表中得来的,且不充许重复,下面的代码要求从前面两个表中提取不重复的名字填入统计表Sdt中,下面的代码运行不了?
Dim skxms As List (of String)
Dim skxms1 As List (of String)
Dim i,l As Integer
If e.DataCol.name="xingming" Then
skxms=DataTables("Sdt").getvalues("Xingming")
For Each skdt As DataTable In DataTables
skxms1=DataTables("skdt").getvalues("Xingming")
l=skxms1.count
For i=0 To l-1 Step 1 '在命令窗口显示数组的长度.
If skxms.Contains(" & skxms1(i)")=False And e.DataRow("Xingming") Is Nothing Then
e.DataRow("Xingming") = skxms1(i)
i=i+1
Else If skxms.contains(" & skxms1(i)")=False And e.DataRow("Xingming") IsNot Nothing Then
Dim skdr As DataRow
skdr = DataTables("sdt").AddNew()
skdr("Xingming") = skxms1(i)
End If
Next
Next
End If