title: VB.NET 2010 database search
body: <p>I have a ms access database connected to my vb application through the data wizard.
  i want to allow the user to search the database and display their results on a datagrid.
  for example user searches for 50 – 55 year Old man under 1.8 meters in height</p>
  
  <p>so far i can display the total amount of people on the database with this code</p>
  
  <pre><code>    Private Sub lblTotalPeople_Click(sender As System.Object, e As System.EventArgs) Handles lblTotalPeople.Click
      Dim con As OleDbConnection = New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\AssignmentDatabase.accdb")
      ' Use wildcard'
      Dim cmd As OleDbCommand = New OleDbCommand("Select COUNT(*) From Table1", con)
      '' or Where username='" &amp; TextBox1.Text &amp; "'
      con.Open()
      Dim myDA As OleDbDataAdapter = New OleDbDataAdapter(cmd)
      Dim myDataSet As DataSet = New DataSet()
      myDA.Fill(myDataSet, "Table1")
      DataGridView2.DataSource = myDataSet.Tables("Table1").DefaultView
  
  End Sub
  </code></pre>
  
  <p>how would i search the database based on what the user searches or what would i use?</p>