title: Link WPF Combobox with Postgres Database values
body: <p>I am trying to populate a combobox with data from a postgres database but I cant get it work.</p>
  
  <p>C# code :</p>
  
  <pre><code>private void fill_combo()
  {
      string CommandText = "select ida from antenne";
      using (NpgsqlConnection sqlConn = new NpgsqlConnection("server=localhost;port=5432;user=postgres;pwd=password;database=BDTelecom"))
      {
          sqlConn.Open();
          NpgsqlCommand sqlCmd = new NpgsqlCommand(CommandText, sqlConn);
          NpgsqlDataAdapter da = new NpgsqlDataAdapter(sqlCmd);
          DataTable dt = new DataTable();
          da.Fill(dt);
          comboBox.Text = "ida";
      }
  }
  </code></pre>
  
  <p>XAML code :</p>
  
  <pre><code>&lt;ComboBox x:Name="comboBox"
            HorizontalAlignment="Left" Height="23" VerticalAlignment="Top" Width="170"
            ItemsSource="{Binding}" /&gt;
  </code></pre>
  
  <p>Any ideas?</p>