-- hello there!, here i am again asking for some help... i want to retrieve my data from my ms access database and i it gave me this error..
"Index was outside the bounds of the array."
can someone help me about this?.. i put my code on my radio button function because, what i wanted to happen is when the user selected the "vote by party list" selection the party list names will automatically load on the activated combo box.
here's my code..
Private Sub rbPartylist_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles rbPartylist.CheckedChanged If rbPartylist.Checked = True Then cbPartylist.Enabled = True constr = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source = " & Application.StartupPath & _ "\SSC_Automation.mdb; Persist Security Info = False" cn.ConnectionString = constr cmd = New OleDbCommand("select CandPosition from tblCandidates", cn) cn.Open() dr = cmd.ExecuteReader While dr.Read() cbPartylist.Items.Add(dr(9).ToString()) End While End If End Sub