以下是引用dreamyuan在2013-1-22 17:28:00的发言:
改了还是有问题呢,会出现空值
呵呵,确实,这次可以了。
Dim ls As New List(Of String)
Dim idx As New List(Of Integer)
For Each dr As DataRow In DataTables("表A").DataRows
Dim name As String = dr("第一列").substring(0, dr("第一列").indexof("-"))
If ls.Contains(name) = False Then
ls.Add(name)
Dim fdr As DataRow = DataTables("表A").Find("第一列 like '" & name & "-*'", "第一列 desc")
idx.Add(fdr("_Identify"))
dr("第二列") = "无效"
fdr("第二列") = "有效"
Else If idx.Contains(dr("_Identify")) = False Then
dr("第二列") = "无效"
End If
Next