title: C# - How to filter ComboBox2 data by ValueMember of ComboBox1 using DataSet
body: <p>I have a Windows Form with two comboBoxes, each one is populated using a DataSet and a TableAdapter. <code>ComboBox1</code> contains Employee's names and <code>ComboBox2</code> contains the territories assigned to all employees. I would like to be able to select an employee's name and filter the <code>ComboBox2</code> to display only the employee's assigned territories.</p>
  
  <p>Here is what I got so far:</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.ComponentModel;
  using System.Data;
  using System.Drawing;
  using System.Linq;
  using System.Text;
  using System.Threading.Tasks;
  using System.Windows.Forms;
  
  namespace Prueba2
  {
  public partial class Form1 : Form
  {
      public Form1()
      {
          InitializeComponent();
      }
  
      public void LlenaEmpleados()
      {
          DataSet1 ds = new DataSet1();
          DataSet1TableAdapters.EmployeesTableAdapter Adapter = new DataSet1TableAdapters.EmployeesTableAdapter();
  
          Adapter.FillEmployees(ds.Employees);
  
          ds.Employees.Columns.Add("FullName", typeof(string), "FirstName +' '+ LastName");
  
          cbPrimero.DataSource = ds.Tables["Employees"];
          cbPrimero.DisplayMember = "FullName";
          cbPrimero.ValueMember = "EmployeeID";
      }
      public void LlenaTerritorios()
      {
          DataSet1 ds = new DataSet1();
          DataSet1TableAdapters.TerrioriosTableAdapter Adapter = new DataSet1TableAdapters.TerrioriosTableAdapter();
  
          Adapter.FillTerritorios(ds.Territorios);
  
          cbSegundo.DataSource = ds.Tables["Territorios"];
          cbSegundo.DisplayMember = "TerritoryDescription";
          cbSegundo.ValueMember = "EmployeeID";
      }
  
      private void Form1_Load(object sender, EventArgs e)
      {
          LlenaEmpleados();
          cbPrimero.Text = "";
  
          LlenaTerritorios();
          cbSegundo.Text = "";
      }
  
      private void cbPrimero_SelectedIndexChanged(object sender, EventArgs e)
      {
          cbPrimero.AutoCompleteSource = AutoCompleteSource.ListItems;
          cbPrimero.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
      }
  }
  }
  </code></pre>
  
  <p>I have searched for the solution, But they do it with a SQL query not using the DataSet. </p>