title: how to delete a user in a mysql server based on search results?
body: <p><img src="https://i.stack.imgur.com/HRzZV.png" alt="sample"></p>
  
  <p>I have a datagrid control with a list of names that it retrieves from a MySql database. I can search through them until i have one result. I want to be able to Display a groupbox control when the number of results is equal to 1. Also, in the groupbox i have a button that when clicked will delete this user from the server and their information from the mysql table called "employee". when the user is deleted i'll display a confirmation message in a messagebox, and reload the table with the updated list. so far the only two problems i have are showing the groupbox when the results are equal to 1 and deleting the user from the sql server based on the name of the search result.  im using vb.net in visual basic 2010 express on windows 7 laptop. Thanks!</p>
  
  <p><strong>EDIT1:</strong></p>
  
  <p>Heres my code so far, please suggest how i can apply your answers to it. Thanks!</p>
  
  <pre><code>Private Sub TextBox1_KeyUp(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles TextBox1.KeyUp
      'Search Function.
      Dim sqlsearch1 As MySqlCommand = New MySqlCommand("SELECT * FROM employee where name LIKE '%?name%' GROUP BY name;", con)
      Dim sqlsearch2 As MySqlCommand = New MySqlCommand("SELECT * FROM employee where title LIKE '%?title%' GROUP BY title;", con)
      sqlsearch1.Parameters.AddWithValue("?name", TextBox1.Text)
      sqlsearch2.Parameters.AddWithValue("?title", TextBox1.Text)
  
      If RadioName.Checked = True Then
          con.Open()
  
          Dim table As DataTable
          For Each table In ds.Tables
          Next
          ' Clear all rows of each table.
          ds.Clear()
  
          ' display results in Datagrid1.
          DataAdapter1.SelectCommand = sqlsearch1
          DataAdapter1.Fill(ds, "stratos")
          DataGrid1.DataSource = ds
          DataGrid1.DataMember = "stratos"
          con.Close()
      Else
      End If
  
      If RadioTitle.Checked = True Then
          con.Open()
  
          Dim table As DataTable
          For Each table In ds.Tables
          Next
          ' Clear all rows of each table.
          ds.Clear()
  
          ' display results in Datagrid1.
          DataAdapter1.SelectCommand = sqlsearch2
          DataAdapter1.Fill(ds, "stratos")
          DataGrid1.DataSource = ds
          DataGrid1.DataMember = "stratos"
          con.Close()
      Else
      End If
  End Sub
  </code></pre>