title: Refresh ComboBox
body: <p>I've tried to make the <code>ComboBox</code> refresh itself after I click the delete button, but when I try this it gives me the error: </p>
  
  <blockquote>
    <p>Items collection cannot be modified when the DataSource property is set.</p>
  </blockquote>
  
  <p>This is the code from the <code>Delete</code> button:</p>
  
  <pre><code>private void deleteBttn_Click(object sender, EventArgs e)
  {
     con.Open();
     string Query = "DROP TABLE [" + comboBox1.SelectedValue.ToString() + "]";
     SqlCommand cmd = new SqlCommand(Query, con);
  
     SqlDataReader myReader;
  
     try
     {          
        myReader = cmd.ExecuteReader();
        MessageBox.Show("Deleted");
  
        this.comboBox1.Items.Remove(this.comboBox1.SelectedItem);
     }
     catch (Exception ex)
     {
        MessageBox.Show(ex.Message);
     }
  
     con.Close();    
  }
  </code></pre>
  
  <p>And this is the code from the <code>ComboBox</code>:</p>
  
  <pre><code>try
  {
     con.Open();
  
     SqlCommand sqlCmd = new SqlCommand();
  
     sqlCmd.Connection = con;
     sqlCmd.CommandType = CommandType.Text;
     sqlCmd.CommandText = "Select TABLE_NAME from INFORMATION_SCHEMA.tables";
  
     SqlDataAdapter sqlDataAdap = new SqlDataAdapter(sqlCmd);        
  
     DataTable dtRecord = new DataTable();
     sqlDataAdap.Fill(dtRecord);
     comboBox1.DataSource = dtRecord;
     comboBox1.DisplayMember = "table_name";
     comboBox1.ValueMember = "table_name";
  
     con.Close();
     }
     catch (Exception ex)
     {
        MessageBox.Show(ex.Message);
     } 
  </code></pre>