Adblock breaks this site

Binding Combobox to a dataset

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

  1. WalangAlam

    WalangAlam Guest

    Referrals:
    0
    Binding Combobox to a dataset

    USERNAMEComboBox.DataSource = dsMyDataset <--- tried this code but it didnt work. how to?
     
  2. dodge

    dodge Active Member
    Banned

    Joined:
    Mar 26, 2007
    Posts:
    125
    Referrals:
    1
    Sythe Gold:
    5
    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 >


 
 
Adblock breaks this site