Jump to content

Problema com combobox não carrega todos os itens da sub categoria


XerTroV

Recommended Posts

Boa tarde,  estou fazendo esta ferramenta porem estou tendo problema para o combobox selecionar todos os itens na tabela vinculados a mesma index, o programa só esta puxando o primeiro item alguém poderia ajudar a solucionar o problema no código ?

pW2OQjv.jpg

 

    Private Sub ComboBox4_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox4.SelectedIndexChanged
        Dim con As SqlConnection = New SqlConnection(strCon)
        Dim command As New SqlCommand("Select * from Character where name = '" & ComboBox4.Text & "'", con)
        Dim adapter As New SqlDataAdapter(command)
        Dim table As New DataTable()
        adapter.Fill(table)
        ComboBox5.DataSource = table
        ComboBox5.DisplayMember = "AccountID"
        ComboBox5.ValueMember = "name"
        ComboBox5.Text = ""
    End Sub

Obrigado.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.