title: Populate data from dataset and show in datagridview
body: <p>I am working in VB.NET and I have a simple requirement:</p>
  
  <p>I have added a MDB file to a DataSet and it contains 21 tables.</p>
  
  <p>I have a DataGridView and a ComboBox on my form.</p>
  
  <p>I was able to get the ComboBox populated with the table names available in the DataSet by iterating through <code>dataset.Tables</code>.</p>
  
  <p>Now I want to the user to be able to select the table name from the ComboBox and then  populate the contents of that table.</p>
  
  <p>I tried the following code:</p>
  
  <pre><code>Datagridview1.DataSource = dataset1
  Datagridview1.DataMember = dataset1.tables(combobox1.selecteditem)
  Datagridview1.Refresh()
  </code></pre>
  
  <p>But I only got the column headers. Then I read that I need a TableAdapter to populate the DataSet with that table. But if I use the TableAdapter then I won't be able to populate the table in a generic way.</p>
  
  <p>Currently if I have to populate <code>TableA</code> then I will have to create an instance of <code>Dataset1TableAdapters.TableA</code> and then use it's <code>.Fill</code> property to populate the table. I will also have to use "Dataset1TableAdapters.TableB`. Is there a generic method to populate <strong>any</strong> table in the DataSet?</p>