Note that you have ten columns in you table and the rows returned may have a match in just column 1, or in columns 5 & 7, or in column 10, or in all columns, or some other combination. You haven't specified whether your SQL query is designed to return only one row or multiple rows. If it is one row, then you need to have ten TextBoxes and only populate the ones that correspond to fields that contain the search term. If it is multiple rows then a ListView may be more appropriate, with only the columns populated that correspond to fields that contain the search term. I'll give an example of each that uses three columns for brevity. You will have to think a bit and adapt it to your exact situation yourself. Also, I'm going to use a data adapter to fill a DataTable. If you have no intention of updating the data, or it is only a single row, it may be more appropriate to use a data reader.
[color=blue]Private Sub[/color] RetrieveData()
[color=blue]Dim[/color] connection [color=blue]As New[/color] OleDbConnection
[color=blue]Dim[/color] selectSQL [color=blue]As String[/color] = [color=blue]String[/color].Format("SELECT * FROM Table1 WHERE field1 LIKE '%{0}%' OR field2 LIKE '%{0}%' OR field3 LIKE '%{0}%'", _
[color=blue]Me[/color].searchTermTextBox.Text.Trim())
[color=blue]Dim[/color] adapter [color=blue]As New[/color] OleDbDataAdapter(selectSQL, connection)
[color=blue]Dim[/color] table [color=blue]As New[/color] DataTable("Results")
adapter.Fill(table)
[color=green]'*** The following section would be used if you have a single row to display in text boxes ***[/color]
[color=green]'Assuming a single row is returned, fill text boxes from the first (and only) row.[/color]
[color=blue]Dim[/color] theRow [color=blue]As[/color] DataRow = table.Rows(0)
[color=blue]If CStr[/color](theRow("field1")).IndexOf([color=blue]Me[/color].searchTermTextBox.Text.Trim()) = -1 [color=blue]Then[/color]
[color=green]'The field does not contain the search term.[/color]
[color=blue]Me[/color].field1TextBox.Clear()
[color=blue]Else[/color]
[color=blue]Me[/color].field1TextBox.Text = [color=blue]CStr[/color](theRow("field1"))
[color=blue]End If[/color]
[color=blue]If CStr[/color](theRow("field2")).IndexOf([color=blue]Me[/color].searchTermTextBox.Text.Trim()) = -1 [color=blue]Then[/color]
[color=green]'The field does not contain the search term.[/color]
[color=blue]Me[/color].field2TextBox.Clear()
[color=blue]Else[/color]
[color=blue]Me[/color].field2TextBox.Text = [color=blue]CStr[/color](theRow("field2"))
[color=blue]End If[/color]
[color=blue]If CStr[/color](theRow("field3")).IndexOf([color=blue]Me[/color].searchTermTextBox.Text.Trim()) = -1 [color=blue]Then[/color]
[color=green]'The field does not contain the search term.[/color]
[color=blue]Me[/color].field3TextBox.Clear()
[color=blue]Else[/color]
[color=blue]Me[/color].field3TextBox.Text = [color=blue]CStr[/color](theRow("field1"))
[color=blue]End If[/color]
[color=green]'*********************************************************************************************[/color]
[color=green]'*** The following section would be used if you have multiple rows to display in a list view ***[/color]
[color=blue]Dim[/color] item [color=blue]As[/color] ListViewItem
[color=blue]For Each[/color] row [color=blue]As[/color] DataRow [color=blue]In[/color] table.Rows
item = [color=blue]New[/color] ListViewItem
[color=blue]If CStr[/color](row("field1")).IndexOf([color=blue]Me[/color].searchTermTextBox.Text.Trim()) = -1 [color=blue]Then[/color]
[color=green]'The field does not contain the search term.[/color]
item.Text = [color=blue]String[/color].Empty
[color=blue]Else[/color]
item.Text = [color=blue]CStr[/color](row("field1"))
[color=blue]End If[/color]
[color=blue]If CStr[/color](row("field2")).IndexOf([color=blue]Me[/color].searchTermTextBox.Text.Trim()) = -1 [color=blue]Then[/color]
[color=green]'The field does not contain the search term.[/color]
item.SubItems.Add([color=blue]String[/color].Empty)
[color=blue]Else[/color]
item.SubItems.Add([color=blue]CStr[/color](row("field2")))
[color=blue]End If[/color]
[color=blue]If CStr[/color](row("field3")).IndexOf([color=blue]Me[/color].searchTermTextBox.Text.Trim()) = -1 [color=blue]Then[/color]
[color=green]'The field does not contain the search term.[/color]
item.SubItems.Add([color=blue]String[/color].Empty)
[color=blue]Else[/color]
item.SubItems.Add([color=blue]CStr[/color](row("field3")))
[color=blue]End If[/color]
[color=blue]Next[/color]
[color=blue]Me[/color].resultsListView.Items.Add(item)
[color=green]'*********************************************************************************************[/color]
[color=blue]End Sub[/color]
Note the use of wildcards in the SQL statement to return rows that contain the search term anywhere in any field.