I have a dataset that contains multiple values. I want to take those rows from that dataset from the datatable BLABLA that contains an "S" with the numbers from zero to six. Then I want to display those in a MessageBox.
My Regex is S[0-6]
.
Dim answer As String = ""
Dim myregex As Regex = New Regex("S[0-6]")
Dim SearchRows() As DataRow = datasetB.Tables("BLABLA").Select("Data LIKE '%myregex%'")
For k As Integer = 0 To SearchRows.Length - 1
If answer = "" Then
answer = SearchRows(k).Item("Data")
Else
answer = answer & vbNewLine & SearchRows(k).Item("Data")
End If
Next
MsgBox(answer)
Unfortunately SearchRows
is empty. I couldn't find the reason by debugging.
What am I doing wrong?