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

  • Home
  • SEARCH
  • 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 6216061
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T07:09:58+00:00 2026-05-24T07:09:58+00:00

I have finished a code sequence to insert data from a DataSet into a

  • 0

I have finished a code sequence to insert data from a DataSet into a combobox, but it seemed like an awful lot of work. I thought there may have been a shorter way, then I thought about this question. Is it possible to convert a set of rows in a column of a table in a dataset to a list which can be entered into a combobox with minimal coding effort?

The approaches I have tried was to use the Dataset.Tables[0].Select() to return a dataRowCollection, but that idea crashed and burned – the combobox didn’t want to accept it.

The other approach I tried worked, but it seemed like a similar approach I had with my longer code:

DataSet comboBoxItems = new SQLCommands().GetStockIDs();  //Calls the uspGetStockIDs Stored procedure,Returning 1 Column (StockID from Stock Table)
cbStockID.Items.Clear(); //Clears the Combobox
foreach (DataRow dr in comboBoxItems.Tables[0].Rows)  //Then Iterates through the retrieved rows
{
    cbStockID.Items.Add(dr.Field<int>(0)); //and places them in the combobox
}

But the code above did not answer my question. This is where I rephrase my question: Is it possible to convert a set of rows in a column of a table in a dataset to a list which can be entered into a combobox with minimal coding effort?

  • 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-05-24T07:10:01+00:00Added an answer on May 24, 2026 at 7:10 am

    Is there a reason you can’t use common data binding in your scenario? This should work:

    cbStockID.DataSource = comboBoxItems.Tables[0];
    cbStockID.DisplayMember = "{DisplayTableColumnName}"; //Displayed items in the combo box.
    cbStockID.ValueMember = "{ValueTableColumnName}"; //Value for items displayed in combo box.
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have just finished ridding my project of leaks, but there are still thousands
I have pretty much finished my first working Symbian application, but in my hastened
after I have finished my code , it run perfectly. i want to try
I have almost finished my iPhone app and would like to send it in
I'm trying to show a div AFTER all other animations have finished. The code
I have some code that sends multiple ASIHTTPRequests to upload and download data in
So I am just starting out developing PHP web applications and have finished setting
I need to delete my input file securely once I have finished with it,
Age old question! When you have finished developing and testing your ASP.Net web application,
I have finally finished my web site. I published it, and I was surprised

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.