HELP!!! Visual basic 2005 Combo Box
hi all,
i'm currently using visual basic 2005, trying to retreive data form SQL database and display them in a combobox. However after running the page (code in blue below) and selecting one of the elements, the elements in the combox list get reduced to one. Where are all the other elements and how to ensure that all the elements remain in the combobox list after selecting an element from the combobox list. Thanks =)
Public Class Form2
Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.CustomersTableAdapter.Fill(Me.NorthWindDataSet. Customers)
End Sub
Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
Me.CustomersTableAdapter.FillByCustomerID(Me.North WindDataSet.Customers, ComboBox1.SelectedValue)
'ComboBox1.Refresh()
'Me.CustomersTableAdapter.Fill(Me.NorthWindDataSet .Customers)
End Sub
End Class
|