Dim s1 As String = "|开发者|管理员|测试员"
Dim s As String
For Each dt As DataTable In DataTables
If dt.DataCols.Contains(s1) Then
For Each dr As DataRow In dt.DataRows
If s.Contains(s1) = True Then
Else
dr("用户") = dr("用户") & s1
End If'
Next
End If
Next
检查所有表,如果包含 用户 列 检查是否包含 s1 如果没有全部植入
是"|开发者|管理员|测试员"这3个都没有才添加,还是说只要判断其中一个没有就添加
For Each dt As DataTable In DataTables
If dt.DataCols.Contains("用户") Then
For Each dr As DataRow In dt.DataRows
If dr("用户").Contains("开发者") = false Then
dr("用户") = dr("用户") & "|开发者"
End If'
If dr("用户").Contains("管理员") = false Then
dr("用户") = dr("用户") & "|管理员"
End If'
If dr("用户").Contains("测试员") = false Then
dr("用户") = dr("用户") & "|测试员"
End If'
Next
End If
Next