When searching for a users full name and is found. I would like to retrieve the rest of the users info from all the table columns and display them in text boxes. Eg textbox1=ID, textbox2=userInitials, textbox3=userEmail
When I run the code below, I receive the message box "User Found" but I don't know if this is actually working as I am not returning any values. How would I do this? Many thanks.
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
Dim searchQuery As String = "Select * from userInfoTable where [userFullName]= '" & SearchName.Text & "'"
ExecuteQuery(searchQuery)
MessageBox.Show("User Found.")
End Sub
Public Sub ExecuteQuery(query As String)
Dim command As New SqlCommand(query, connection)
connection.Open()
command.ExecuteNonQuery()
connection.Close()
End Sub