Binding Combobox to a dataset

Discussion in 'Programming General' started by WalangAlam, May 15, 2007.

Binding Combobox to a dataset
  1. Unread #1 - May 15, 2007 at 3:42 AM
  2. WalangAlam
    Referrals:
    0

    WalangAlam Guest

    Binding Combobox to a dataset

    USERNAMEComboBox.DataSource = dsMyDataset <--- tried this code but it didnt work. how to?
     
  3. Unread #2 - May 15, 2007 at 8:47 AM
  4. dodge
    Joined:
    Mar 26, 2007
    Posts:
    125
    Referrals:
    1
    Sythe Gold:
    5

    dodge Active Member
    Banned

    Binding Combobox to a dataset

    maybe if you post more of your code i can see whet the problem is, the way you posted is the way it should be.

    here is a small example on how this works and it works perfect, create a new form and place a button in the form the copy this code

    Code:
        Public Enum SampleEnum
            test1
            test2
            test3
            test4
            test5
            test6
            test7
            test8
            test9
            test0
        End Enum
    
        Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
            Dim sampleSelectorCombo As ComboBox = New ComboBox
            sampleSelectorCombo.DataSource = System.Enum.GetNames(GetType(SampleEnum))
            sampleSelectorCombo.Dock = DockStyle.Top
            Me.Controls.Add(sampleSelectorCombo)
        End Sub
    
     
< Rename Worksheet in excel through codes | Saving and retrieving image from SQL Server database >

Users viewing this thread
1 guest


 
 
Adblock breaks this site