Hi there,
I wonder if anybody can help me.... I am looping through a DataGridView and checking the returned string value (strTag) against another string I have (strMyString). My problem is that I have several columns, but I only want to iterate through the Column Named 'TAG_NUMBER'.
Here is what I have so far.. it is working, apart from the fact it appears to be looping through all the columns.
Any help anybody can offer is much appreciated!!!
I wonder if anybody can help me.... I am looping through a DataGridView and checking the returned string value (strTag) against another string I have (strMyString). My problem is that I have several columns, but I only want to iterate through the Column Named 'TAG_NUMBER'.
Here is what I have so far.. it is working, apart from the fact it appears to be looping through all the columns.
VB.NET:
Dim strTag as String
Dim dv As New DataView(dbMyDbase.Tables(0))
dv.Sort = "TAG_NUMBER"
For rc As Integer = 0 To dv.Table.Rows.Count - 1
For cc As Integer = 0 To dv.Table.Columns.Count - 1
If dv.Table.Columns.Contains("TAG_NUMBER") Then
strTag = (dv.Table.Rows(rc)(cc).ToString)
If strMyString.Contains(LCase(strTag)) = True Then
msgBox("Found " & strTag)
End If
End If
Next
Next
Any help anybody can offer is much appreciated!!!
Last edited: