Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dataview in loops?

Status
Not open for further replies.

fcoomermd

Programmer
Nov 20, 2002
218
CA
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top