title: OleDB Select Statement
body: <p>I have a search button in my program. What I want is every time I search I will type the <code>lastname</code> and when the <code>lastname</code> is equivalent to any <code>lastname</code> in the database, the <code>firstname</code> and the <code>lastname</code> of the person will be displayed in a <code>listbox</code> and whenever I click on the result in the <code>listbox</code>, the person's details will be displayed in the <code>textboxes</code>. The problem is when there are persons with same surname, their names are listed uniquely but when I click on the name, same details appear in the <code>textboxes</code>.</p>
  
  <p>Please help.</p>
  
  <p>Here's my code:</p>
  
  <pre><code>    connection.Open();
      OleDbCommand select = new OleDbCommand();
      select.Connection = connection;
      select.CommandText = "Select * From Accounts Where Lastname  = '" + searchtb.Text + "'";
      OleDbDataReader reader = select.ExecuteReader();
      while (reader.Read())
      {
          listBox1.Items.Add(reader[1].ToString() + "," + reader[2].ToString());
      }
      connection.Close();
  </code></pre>