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 8955623
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T14:36:01+00:00 2026-06-15T14:36:01+00:00

I got 2 comboboxes on my form(in the form load event). First combobox gets

  • 0

I got 2 comboboxes on my form(in the form load event). First combobox gets a value from a select statement once the form loads. I want to use that value in my second combobox. Here is my code:

1ste Combobox = cbDelivery

        OracleConnection conn = new OracleConnection();
        conn.ConnectionString = "User Id=christob;Password=CHRISTOB;Host=poseidon;Pooling=true;Min Pool    Size=0;Max Pool Size=100;Connection Lifetime=0;Port=1522;Sid=GLODCD";

        conn.Open();

        string query;
        query = "select distinct dd.delivery_bay_code from dc_delivery dd, dc_grv dg where delivery_complete_datetime is null and dd.dc_delivery_id_no = dg.dc_delivery_id_no and dd.delivery_announce_datetime is null";
        OracleCommand cmd = new OracleCommand(query, conn);
        OracleDataReader dr = cmd.ExecuteReader();
        while (dr.Read())
        {
            cbDelivery.Items.Add(dr["delivery_bay_code"]);
        }
        dr.Close();
        conn.Close();

2de Combobox = cbOrderNo

This combobox is in:

private void cbDelivery_SelectedIndexChanged(object sender, EventArgs
e)

so as soon as I select a value from 1ste combobox my 2nd combobox query must populate the 2nd combobox. See code:

        OracleConnection conn = new OracleConnection();
        conn.ConnectionString = "User Id=christob;Password=CHRISTOB;Host=poseidon;Pooling=true;Min Pool Size=0;Max Pool Size=100;Connection Lifetime=0;Port=1522;Sid=GLODCD";
        conn.Open();
        string query1;
        query1 = "select distinct dg.order_no from dc_delivery dd, dc_grv dg where delivery_complete_datetime is null and dd.dc_delivery_id_no = dg.dc_delivery_id_no and dd.delivery_announce_datetime is null and dd.delivery_bay_code = " + cbDelivery.Text;
        OracleCommand cmd1 = new OracleCommand(query1, conn);
        OracleDataReader dr1 = cmd1.ExecuteReader();
        while (dr1.Read())
        {
            cbOderNo.Items.Add(dr1["order_no"]);

        }
        dr1.Close();
        conn.Close();

Note I’m using cbDelivery combobox in my second Select query.

Problem is:
As soon as I select a value from my first combobox the second gives an exception “”ORA-00904: “BAY1”: Invalid Identifier.

Please help me sort this out or suggest a different method.

Thanks in Advance.

  • 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-15T14:36:02+00:00Added an answer on June 15, 2026 at 2:36 pm

    FIXED!! This is how i did it:

    private void populateDeliveryBayCodes()
        {
            conn.Open();
            string query;
            query = "select distinct dd.delivery_bay_code from dc_delivery dd, dc_grv dg where dd.delivery_complete_datetime is null and dd.dc_delivery_id_no = dg.dc_delivery_id_no and dd.delivery_announce_datetime is null";
            OracleCommand cmd = new OracleCommand(query, conn);
            OracleDataReader dr = cmd.ExecuteReader();
            while (dr.Read())
            {
                cbDelivery.Items.Add(dr["delivery_bay_code"]);
            }
            dr.Close();
            conn.Close();
        }
    
        private void populateOrderNumbers()
        {
            conn.Open();
            string query;
            query = "select distinct dg.order_no from dc_delivery dd, dc_grv dg where dd.delivery_complete_datetime is null and dd.dc_delivery_id_no = dg.dc_delivery_id_no and dd.delivery_announce_datetime is null and dd.delivery_bay_code ='" + cbDelivery.Text + "' order by order_no";
            OracleCommand cmd = new OracleCommand(query, conn);
            OracleDataReader dr = cmd.ExecuteReader();
            while (dr.Read())
            {
                cbOderNo.Items.Add(dr["order_no"]);
            }
            dr.Close();
            conn.Close();
        }
    

    and

    private void frmBuiltPallet_Load(object sender, EventArgs e)
        {
            populateDeliveryBayCodes();
        {
    
    private void cbDelivery_SelectedIndexChanged(object sender, EventArgs e)
        {
            populateOrderNumbers();
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I got a form with multiple comboboxes, where each combobox can be set to
I have got two comboboxes on my application. The first combobox can get all
I got a combobox that is populated from a access database. How can I
I've got a problem with VB6. I have a form with several ComboBox objects
I got a extjs 4 combobox within a form bound to a model. I
I use Silverlight 4.0 and have got problems with ComboBox control. I want to
I've got a few cascading comboboxes on my WPF form, each bound to a
I've got the following simple comboBox in my page. <rich:comboBox value=#{groupConfig.group} styleClass=userCombo filterNewValues=false directInputSuggestions=true>
I am having a WPF dataentry form which has got 3 comboboxes which needs
I've got a combobox that opens a new form window with a datagridview, and

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.