You should consider moving that code onto a button click event.
Otherwise the query will be fired for every keystroke you use in the textbox.
And you are very close to the solution, my friend. :)
Notice my lack of use of the SqlConnection object. It will work anyway, because the SqlDataAdapter will take care of connecting to the database. If provided with the connection string.
The SqlCommandBuilder will help take care of creating INSERT, UPDATE and DELETE statements for you.
Private bindingSource1 As New BindingSource
Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load
AuthorsGridView.DataSource = bindingSource1
End Sub
Private Sub TextBoxId_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBoxIdSearchExist.TextChanged
Try
da = New SqlDataAdapter("SELECT * FROM pay WHERE t_id = '" & tId.Text & "'", <your connection string>)
Dim builder As New SqlCommandBuilder(da)
da.Fill(ds, "pay") 'Needs to be the name of the source table
'I don't know what GetData(queryString) is for, so I'm ignoring it
If ds.Tables.Count > 0 Then
bindingSource1.DataSource = ds.Tables(0)
Else
MessageBox.Show("No results found in database.")
End If
Catch ex As Exception
MessageBox.Show("Unable to connect to database, or an error occured.")
End Try
End Sub