Hi,
How can i check if a dataset contains a specific value? It's crazy that no one has done this before. Couldn't find it on the net!!!
Hi,
How can i check if a dataset contains a specific value? It's crazy that no one has done this before. Couldn't find it on the net!!!
You mean go through the entire dataset tables, columns and rows?
Here is something that could help you:
Dim valueToSearch as String = "some text"
For Each dTable As DataTable In ds.Tables
For Each dRow As DataRow In dTable.Rows
For index As Integer = 0 To dTable.Columns.Count - 1
Convert.ToString(dRow(index)).Contains(valueToSearch)
Next
Next
Next