title: Show items in listbox from database in C#
body: <p>I have have a database with two tables <code>Countries</code> and <code>Websites</code>. I am displaying all countrynames in listbox1 with the following statement: </p>
  
  <pre><code>try
  {
  
      connection.Open();
      using (OleDbCommand command = new OleDbCommand())
      {
          command.Connection = connection;
          command.CommandText = "SELECT CountryName FROM Countries ";
          //whenever you want to get some data from the database
          using (OleDbDataReader reader = command.ExecuteReader())
          {
              while (reader.Read())
              {
                  listBox1.Items.Add(reader["CountryName"].ToString());
              }
          }
      }
  }
  catch (Exception l)
  {
      MessageBox.Show("Error:" + l);
  }
  finally
  {
      connection.Close();
  }
  </code></pre>
  
  <p>However know based on what Item the user selects in listbox1 I want listbox two to display the relevant websites that are linked to the country in the database. The foreign key in the website table is <code>CountryIDFK</code> and I want to display the field <code>WebsiteName</code> of the second table. </p>
  
  <p>I somehow don't know how to show the items in listbox2. I don't want to add them in the second listbox but rather just show based on what country the user has selected. Can someone assist please ?</p>