title: Combo box not refreshed after insert/delete records
body: <p>I am using vb.net and access 2007
  I have a problem regarding combo box refresh</p>
  
  <p>This is my code:</p>
  
  <pre><code>Private Sub comboRefresh()
  
      Try
          cmbSn_no.DataSource = Nothing
          cmbSn_no.Items.Clear()
  
          Dim asql As String = ("SELECT * FROM Vendor_det")
          da = New OleDb.OleDbDataAdapter(asql, cnnOLEDB)
          da.Fill(ds, "Vendor_det")
  
          cmbSn_no.ValueMember = "sr_no"
          cmbSn_no.DataSource = ds.Tables(0)
          cmbSn_no.SelectedIndex = 0
  
  
          'DataGridView1.DataSource = ds.Tables(0)
          'DataGridView1.Update()
  
      Catch ex As Exception
          MsgBox("ERROR : " &amp; ex.Message.ToString)
  
      End Try
  
  End Sub
  
  Private Sub cmbSn_no_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles cmbSn_no.SelectedIndexChanged
  
  
      Dim asql As String = ("SELECT * FROM Vendor_det where sr_no='" &amp; cmbSn_no.Text &amp; "'")
      cnnOLEDB.Open()
      cmd = New OleDb.OleDbCommand(asql, cnnOLEDB)
      dr = cmd.ExecuteReader
      If dr.Read = True Then
  
          cmbSn_no.Text = dr("sr_no")
          txtPart_no.Text = dr("part_no")
        .......... 
      End If
      cnnOLEDB.Close()
  End Sub
  </code></pre>
  
  <p>And i call comborefresh() method from add and delete record button click events.
  if i dont use the commented code and click on add / delete button then the output comes some how like this:</p>
  
  <p>records in db:</p>
  
  <p>abcd123
  bbbc123</p>
  
  <p>if i add a record cccc123.. it should update and my combo box should fill with following records:</p>
  
  <p>abcd123
  bbbc123
  cccc123</p>
  
  <p>but it fills with</p>
  
  <p>abcd123
  bbbc123
  cccc123
  abcd123
  bbbc123</p>
  
  <p>and if i use the commented line then the combo box is filled with "System.Data.DataRowView"
  No prompted error comes but i am not getting my answer...
  even i have tried with....</p>
  
  <p>combobox.refresh()
  combobox.selectedindex=-1
  and 
  combobox.items.clear()</p>
  
  <p>it does not work</p>
  
  <p>Please resolve my problem....
  Thank you in advance...:)</p>