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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T07:02:42+00:00 2026-06-17T07:02:42+00:00

I have develeped a DataSet to access information from SQL for a desktop application

  • 0

I have develeped a DataSet to access information from SQL for a desktop application (using WinForms).

Binding data to a ComboBox is nothing new but as i have done most of in ASP.Net, some classes that i would have used just are not available for WinForms, evidently.

So Basically, i need to know what i need to do to bind a combobox to a DataTable and then add a custom item to Index=0, basically states "Select MC". This item will be checked against on SelectionChange but i need to have a Nullification ListItem in the set so i can invalidate the conditional refinement.

I have 3 comboboxes and 1 datagridview. The 3 comboboxes can refine the visible list of information in the gridview but i also want the user to have the ability to unselect their choice.

Here is what i tried and not getting anywhere:

Private Sub frmMain_Load(sender As Object, e As EventArgs) Handles Me.Load
      'cboMC.Datasource = Me._mc.GetMC().AddMCRow("Select MC") <-- Did not Work
    cboMC.DataSource = Me._mc.GetMC()
    cboMC.Items.Insert(0, New Object() {"Select MC"}) <-- Current Try

    ...    
End Sub

Any other suggestions? Again this is a WinForms application and not WebForms.

Final Revision (per @Tebc)

cboMC.Items.Add("Select MC")
cboMC.Items.AddRange(Me._mc.GetMC().ToArray())

Derivative of above making sure Invalidator is at index 0

cboMC.Items.AddRange(Me._mc.GetMC().ToArray())
cboMC.Items.Insert(0, "Select MC")

Worked like a charm….thans for putting me on the correct path.

  • 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-17T07:02:43+00:00Added an answer on June 17, 2026 at 7:02 am

    I don’t recall the exact syntax, but what I have done is something along the lines of:

    1. Create a temp Array with size set to the count of your data table
    2. cboMC.Items.Add(“Select MC”)
    3. use the ToArray function of the data table
    4. cobMC.Items.AddRange([the temp Array])
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have developed an application using C# on Visual Studio 2010 and SQL Server
I have a java application develeped in netbeans. I want to create a batchfile
I have developed a Java server using Eclipse that accepts TCP socket connection from
I have developed a Facebook application using Flash as3. In this application when ever
I have to consume a .NET hosted web service from a Java application. Interoperability
I have developed a VB.NET program using a strongly typed dataset. This dataset has
Have developed an MVC3 application which monitors when users access static content on the
I am a winforms programmer and need to setup a data access website for
I have developed a web application, which runs good when executed from Visual studio.
I'm writing code using Oracle SQL Developer. I have a simple select statement that

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.