title: C# - Fill a combo box with a DataTable
body: <p>I'm used to work with Java where large amounts of examples are available. For various reasons I had to switch to C# and trying to do the following in SharpDevelop:</p>
  
  <pre><code>// Form has a menu containing a combobox added via SharpDevelop's GUI
  
  // --- Variables
  languages = new string[2];
  languages[0] = "English";
  languages[1] = "German";
  DataSet myDataSet = new DataSet();
  
  // --- Preparation
  DataTable lTable = new DataTable("Lang");
  DataColumn lName = new DataColumn("Language", typeof(string));
  lTable.Columns.Add( lName );
  for( int i=0; i&lt;languages.Length; i++ ) {
      DataRow lLang = lTable.NewRow();
      lLang["Language"] = languages[i];
      lTable.Rows.Add(lLang);
  }
  myDataSet.Tables.Add(lTable);
  
  // --- Handling the combobox
  mnuActionLanguage.ComboBox.DataSource = myDataSet.Tables["Lang"].DefaultView;
  mnuActionLanguage.ComboBox.DisplayMember = "Language";
  </code></pre>
  
  <p>One would assume to see some values in the dropdown, but it's empty. Please tell me what I'm doing wrong ;(</p>
  
  <p><em>EDIT:
  mnuActionLanguage.ComboBox.DataBind() is what I also found on the net, but it doesn't work in my case.</em></p>
  
  <p><strong>SOLUTION</strong></p>
  
  <pre><code>mnuActionLanguage.ComboBox.BindingContext = this.BindingContext;
  </code></pre>
  
  <p>at the end solved the problem!</p>