title: Connection open error while calling the sub functions
body: <p>This is the flow of my program..</p>
  
  <pre><code>Private Sub cmdUpdate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdUpdate.Click
       ..
      ....
  
       Call comboRefresh()        ------&gt;
       cmdNext.Text = "Add New"
       cmdEdit.Text = "Edit"
       cmdUpdate.Enabled = False
  End Sub
  
  
  Private Sub comboRefresh()
  
      ------&gt; ....
  
      da.Fill(ds, "Vendor_Machine")
  
          cmbSn_no.ValueMember = "sr_no"
          cmbSn_no.DataSource = ds.Tables(0)  --
          cmbSn_no.SelectedIndex = 0
  
         ....
  End Sub
  
  Private Sub cmbSn_no_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmbSn_no.SelectedIndexChanged
  
    -----&gt;       cnnOLEDB.Open()
     ...
           Dim dr As OleDb.OleDbDataReader = comm_SelVen.ExecuteReader
  
      If dr.Read = True Then
          cmbSn_no.Text = dr("sr_no")
          cmbChal_no.Text = dr("chaln_no") -----&gt;
      End If
      cnnOLEDB.Close()
  
  End Sub
  
   Private Sub cmbChal_no_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmbChal_no.SelectedIndexChanged
    ----&gt;     cnnOLEDB.Open()
      ...
       cnnOLEDB.Close()
  
  End Sub
  </code></pre>
  
  <p>Here It says problem “Connection already open...”and halts execution...  Even i  can’t comment the line <code>---&gt;  cnnOLEDB.Open()</code> in the last sub function as I have to call <code>cmbChal_no_SelectedIndexChanged</code> alone also.. if I comment it give error that</p>
  
  <blockquote>
    <p>Connection is closed, needs to be open to execute DataReader</p>
  </blockquote>
  
  <p>Please suggest me what to do...Thank You</p>