29 | 04 | 2017

Search within Datatable

TO search for a value within a datatable use the code below:

Dim Tbl as DataTable =  '(Specify datatable here)

Dim SearchString As String = "TypeSearchStringHere"   'String to search for within datatable
Dim rowfound As DataRow =TBL.Rows.Find(SearchString )

If rowfound IsNot Nothing Then
    MsgBox(rowfound (1).ToString())  'Resturns the first value of the found row(s). 
Else
    MsgBox("A row with value " & SearchString  & " has not be found")
End If
Login

Sign up now and upload your code to the website.

Help us to continue.....
Statistics
Articles View Hits
2237963
Latest Articles