这个意思?
For Each dr2 As DataRow In DataTables("告知内容").SQLSelect("操作单位='" & _usergroup & "' And 告知内容 Is null ")
Dim dr As DataRow = DataTables("信息模板").sqlfind("操作单位='" & _usergroup & "' And 案件类别 = '" & dr2("案件类别") & "'And 案件状态 = '" & dr2("案件状态") & "' and 适用人员='" & dr2("人员类型") & "'" )
'如果找到记录
If dr IsNot Nothing Then
'定义字符串
Dim str1 As String = dr("模板内容")
'定义遍历内容替换表查找内容
Dim drs1 As List(of DataRow) = DataTables("内容替换表").SQLSelect("")
For Each dr1 As DataRow In drs1
'如果替换内容与列名不等于空时
If dr1("替换内容") > "" And dr1("列名") > "" Then
'如果告知内容表列值中包含内容替换表中的列值时,进行对应替换
If DataTables("告知内容").DataCols.Contains(dr1("列名")) Then
str1 = str1.replace(dr1("替换内容"),dr2(dr1("列名")))
End If
End If
Next
'输入替换后的值,并且写入告知内容表中的告知内容列,然后保存告知内容表
output.show(str1)
dr2("告知内容")=str1
dr2.save
End If
Next