Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Load Distinct .sdf-database column into a ComboBox

Status
Not open for further replies.

RadjeshNL

Technical User
Sep 1, 2008
32
NL
Trying to achieve this and I think that I'm almost there, but I can't get the values itself from the column(s). The connection works perfectly, I can get all the values into a listview, but the combo...

Code:
Dim connStr As New SqlCeConnection("Data Source=" & Application.StartupPath & "\DATABASE_NAME.sdf; Password =")

Dim cmd As New SqlCeCommand("SELECT DISTINCT item FROM tablename", connStr)

connStr.Open()
reader_combo1 = cmd_Plaats.ExecuteReader

While reader_combo1.Read
    mdi_beslag.ts_cbo_plaats.Items.Add("field1") ' <<<<
End While

What am I dong wrong?

(The combobox is btw a combobox in the toostrip)
 
reader_combo1 = cmd_Plaats.ExecuteReader

should be cmd.ExecuteReader btw. Sorry for that.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top