这是我程序的流程..
Private Sub cmdUpdate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdUpdate.Click
..
....
Call comboRefresh() ------>
cmdNext.Text = "Add New"
cmdEdit.Text = "Edit"
cmdUpdate.Enabled = False
End Sub
Private Sub comboRefresh()
------> ....
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
-----> 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") ----->
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
----> cnnOLEDB.Open()
...
cnnOLEDB.Close()
End Sub
在这里它说问题“连接已经打开......”并停止执行......即使我不能评论---> cnnOLEDB.Open()
最后一个子函数中的行,因为我也必须cmbChal_no_SelectedIndexChanged
单独调用......如果我评论它会给出错误
连接已关闭,需要打开才能执行 DataReader
请建议我该怎么做...谢谢