I have a For each loop, and inside I call a routine to see
if I should change a font color based on search in a xml file (data).
The question I have is, is this gonna kill performance? Should I pass a dataset
into the routine? Can I use one dataset, and do sub searches? Something like that?
Here is my structure:
For Each myCtrl In Me.Controls
If overrideApplied(quoteID, chkEB.Text, Replace(ite.Item("type"), " ", "")) Then
overrideColor = Color.Red
else
overrideColor = Color.Black
End If
Next
'Here is the routine that is called rep.
Public Function overrideApplied(ByVal quoteID As String, ByVal empNo As String, ByVal typeAs String) As Boolean
Dim dv As DataView
dv = New DataView(className.dataset.Tables("extension"))
dv.RowFilter.
dv.RowFilter = "QUOTEID='" & quoteID & "' and EMPNO='" & empNo & "' and type='" & type & "'"
If dv.Count > 0 Then
Return True
Else
Return False
End If
End Function
Does the above look ok?
Thanks FC
if I should change a font color based on search in a xml file (data).
The question I have is, is this gonna kill performance? Should I pass a dataset
into the routine? Can I use one dataset, and do sub searches? Something like that?
Here is my structure:
For Each myCtrl In Me.Controls
If overrideApplied(quoteID, chkEB.Text, Replace(ite.Item("type"), " ", "")) Then
overrideColor = Color.Red
else
overrideColor = Color.Black
End If
Next
'Here is the routine that is called rep.
Public Function overrideApplied(ByVal quoteID As String, ByVal empNo As String, ByVal typeAs String) As Boolean
Dim dv As DataView
dv = New DataView(className.dataset.Tables("extension"))
dv.RowFilter.
dv.RowFilter = "QUOTEID='" & quoteID & "' and EMPNO='" & empNo & "' and type='" & type & "'"
If dv.Count > 0 Then
Return True
Else
Return False
End If
End Function
Does the above look ok?
Thanks FC