想在"资产管理表" 显示的时候,分别检索对应的 电脑终端管理表 其它终端管理表 网络交换机管理表 服务器管理表 各表里有没有相同的资产卡片号字段,没有,则改变当前行的颜色,写在drawcell里面,很慢,而且不起作用,要怎么弄?
If e.Row("资产类型")="电脑" And e.Row.IsNull("资产卡片号")=False And e.Row("资产卡片号")<>"N" Then
Dim dr As DataRow = DataTables("电脑终端管理表").SQLFind("资产卡片号='" & e.Row("资产卡片号") & "'")
If dr Is Nothing Then
e.Style = "服务器被删除"
End If
Else If e.Row("资产类型")="其它" And e.Row.IsNull("资产卡片号")=False And e.Row("资产卡片号")<>"N" Then
Dim dr As DataRow = DataTables("其它终端管理表").SQLFind("资产卡片号='" & e.Row("资产卡片号") & "'")
If dr Is Nothing Then '如果提醒间隔超出设定,且任务没完成,也没关闭,则刷红
e.Style = "服务器被删除"
End If
Else If e.Row("资产类型")="交换机" And e.Row.IsNull("资产卡片号")=False And e.Row("资产卡片号")<>"N" Then
Dim dr As DataRow = DataTables("网络交换机管理表").SQLFind("资产卡片号='" & e.Row("资产卡片号") & "'")
If dr Is Nothing Then
e.Style = "服务器被删除"
End If
Else If e.Row("资产类型")="服务器" And e.Row.IsNull("资产卡片号")=False And e.Row("资产卡片号")<>"N" Then
Dim dr As DataRow = DataTables("服务器管理表").SQLFind("资产卡片号='" & e.Row("资产卡片号") & "'")
If dr Is Nothing Then
e.Style = "服务器被删除"
End If
End If
[此贴子已经被作者于2019/1/15 17:21:26编辑过]