Dim errorCols As New List(Of String) From {"错误信息1", "错误信息2", "错误信息3", "错误信息4", "错误信息5", "错误信息6", "错误信息7"}
Dim dt As DataTable = DataTables("脱贫户监测户信息表")
For Each colName As String In errorCols
If dt.DataCols.Contains(colName)=false Then
dt.DataCols.Add(colName, GetType(String), 255)
End If
Next
Dim cmd As New SQLCommand
'cmd.ConnectionName = "数据源名称"
Dim dt2 As DataTable
cmd.CommandText = "select * from {脱贫户监测户信息表} as a where (户类型='脱贫户' or 监测对象类别='监测户') and 工资性收入 > 0 and not exists(select * from {脱贫户监测户信息表} as b where a.户编号=b.户编号 and 务工所在地 is not null)"
dt2 = cmd.ExecuteReader()
dim dr as datarow
for each mr as datarow in dt2.datarows
dr = dt.find("证件号码='" & mr("证件号码") & "'")
if dr isnot nothing then
dr("错误信息1") = "脱贫户和监测户有工资性收入,但家庭成员无务工监测信息"
end if
next