title: How to Refresh ComboBox binding to a DB
body: <p>I have a combo box populated using dataset table adapters. I have a textbox and a button next to it. Onclick of this button the textbox value is added to the database. I want to refresh my Combobox once any new entry has been made. I did my research and figured out that I will have to Create an ObservableCollection and fill it with the data from DB. But since I am using dataset all the classes for each of the table is already present. </p>
  
  <p>Here is my code:</p>
  
  <p><strong>XAML</strong></p>
  
  <pre><code>&lt;ComboBox Name="service" SelectedValuePath="Id" DisplayMemberPath="Service" &gt;&lt;/ComboBox&gt;
  &lt;TextBox Name="txtTobeAdded"&gt;&lt;/TextBox&gt;
  &lt;Button Name="add" Content="Add" Click="add_Click"&gt;&lt;/Button&gt;
  </code></pre>
  
  <p><strong>C#</strong></p>
  
  <pre><code>public partial class Window3 : Window
  {
  
      private SqlDatatsetTableAdapters.ServicesTableAdapter tableAdapterServices = new SqlDatatsetTableAdapters.ServicesTableAdapter();
  
      public Window3()
      {
          InitializeComponent();
          System.Data.DataView vw = tableAdapterServices.GetData().DefaultView;
          service.ItemsSource = vw;
          service.SelectedIndex = 0;
      }
  
      private void add_Click(object sender, RoutedEventArgs e)
      {
          tableAdapterServices.InsertQuery(txtTobeAdded.Text);
      }
  }
  </code></pre>