I got a combobox box that I load at load time. the Item and vales ended up
in reverse order of each other, what went wrong?
the database table has the following row
code value
ebay http://www.ebay.com
google http://www.google.com
yahoo http://www.yahoo.com
However in the drop down list
displayed value used
ebay http://www.yahoo.com
google http://www.google.com
yahoo http://www.google.com
here is the code listing for populating the combobox
Private Sub MainForm_Load(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Load
Dim Conn As New SqlConnection(" Data
source=.\SQLEXP RESS;AttachDbFi leName=C:\myCtl .mdf;Integrated
Security=True;C onnect TimeOut=30;User Instance=True")
Using Conn
Dim queryString As String = "select code, value as Addr from
dbo.CodeTable where (codeTableName = 'FinCoUrl') And (sequence 0) order by
sequence"
Dim adapter As New SqlDataAdapter( )
adapter.SelectC ommand = New SqlCommand(quer yString, Conn)
Dim datatable As New DataTable
adapter.Fill(da tatable)
addressBar.Data Source = datatable.Defau ltView
addressBar.Disp layMember = "code"
addressBar.Valu eMember = "Addr"
End Using
WidthaddressBar = addressBar.Widt h
End Sub
the above code worked with a combox in another application . the only
diffference is the name
Is there some property on the combo I need to fix ?