Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9198505
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T22:18:00+00:00 2026-06-17T22:18:00+00:00

I have a combo box which gets data from a database and a list

  • 0

I have a combo box which gets data from a database and a list box which also gets data from a database.

Now what I’d like to do is change the value on the list box depending on the value of the combo box.

For example of if I select “apple” from a combo box, then in the list it should display the types of apples.

In this case let’s say the types of apples are Granny Smith, Red Delicious, and so on. I hope you guys get what I am trying to say. I have not started to code but I need a method that will allow me to get the desired output. And also I am new to asp.net with vb.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T22:18:01+00:00Added an answer on June 17, 2026 at 10:18 pm
    Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
        ListBox1.Items.Clear()
    
        Dim com As New SqlClient.SqlCommand("SELECT type FROM Tbl WHERE category = '" & ComboBox1.Text & "'", sqlConn)
        Dim sql As SqlClient.SqlDataReader = com.ExecuteReader()
    
        While sql.Read
            ListBox1.Items.Add(sql.GetString(0))
        End While
        sql.Close()
    End Sub
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

OK So I have a combo box which selects an administrator from a list
I have a combobox which binds data from the database. It gets the data
I have a combo box in which I have to display the dates from
I have a combo box that I bind to an observable collection, which gets
I am building a form in access database. I have a combo box which
I have combo box which displays room numbers. Now i want to show room
I have a dynamic combo box which has the URL as the value. I
I have a form which has a Combo Box Control. I have selected the
I have a maximized form which has Combo-Box control (docked in top-right) with 500px
I have this form, in which i need to populate a combo box with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.