Setting Combo Box Defaults in vb Express
Posted on 2014-02-03
I have a combobox linked to an SQL table, see attached code
'Read SQL data source in combobox
cmd = New SqlCommand("SELECT * FROM tbl_ProductStandards", con)
If con.State = ConnectionState.Closed Then con.Open()
Dim sdr As SqlDataReader = cmd.ExecuteReader()
While sdr.Read = True
But i would like to make an automatic selection in the combo box on form open if the combo box is blank
I have tried a variety of things including .selecteditem and although the code does not error, nothing vible ever appears in the combobox.
All suggestions very welcome.