title: remove duplicate from combo box connected to database
body: <p>I am trying to remove duplicates from a <code>Combobox</code>, however, this doesn't seem to result in a correct <code>Combobox</code>, since he fills the <code>Combobox</code> with the following text:</p>
  <pre><code>System.Linq.Enumerable+&lt;DistinctIterator&gt;d__64`1[System.Char]
  </code></pre>
  <p>I have the following code and am using an access database with generated datasets.</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-css lang-css prettyprint-override"><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;
  using System.Linq.Expressions;
  
  namespace Generator
  {
          private void matGroupBindingNavigatorSaveItem_Click(object sender, EventArgs e)
          {
              this.Validate();
              this.matGroupBindingSource.EndEdit();
              this.tableAdapterManager.UpdateAll(this.matGroupDataSet);
          }
          private void frmImport_Load(object sender, EventArgs e)
          {
              this.matGroupTableAdapter.Fill(this.materialGroupDataSet.MatGroup);
  
              //Distinct
              var BaseM = materialGroupDataSet.MatGroup.Select(row =&gt; row["BaseMs"].ToString().Distinct());
              foreach (var BaseMs in BaseM)
              {
                 cmbBaseMat.Items.Add(BaseMs);
              }
  
          }</code></pre>
  </div>
  </div>
  </p>
  <p>I have 3 <code>Comboboxes</code> that I want to fill with data from the database. The <code>ComboBox1</code> is filled with data and then it removes the duplicates correctly.</p>
  <p>However, when I select a value from the <code>ComboBox1</code>, it will update the <code>ComboBox2</code> with the possible choices based on the <code>ComboBox1</code> and if I select a value from the <code>ComboBox2</code> it fills the <code>ComboBox3</code> with resulting data.</p>
  <p>I'm now first trying to filter out the duplicates.</p>