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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T20:42:23+00:00 2026-06-03T20:42:23+00:00

I am new here. And have a big issue which I will really appreciate

  • 0

I am new here. And have a big issue which I will really appreciate if you could help with.

Im developing a software which is just entering some data to the access file and retrieve it after some filtering (done by using date time pickers, radio buttons, combo boxes…etc)

When I want to update any entry I simply write a select query and add those values to relevant fields. But thing is that I cannot update my combo boxes. I got 2 of them. When I try following code it throws errors.

What can I do? pls help me out. Thanks!

cmb_district.ValueMember = dt1.Rows[0][1].ToString();

I use the data source property to connect combo box with access database. It clearly has display and value members. But When query returns the value it do not update the combo box and give following error.

Cannot bind to the new value member.
Parameter name: value

Thanks. Pls help me out!

  • 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-03T20:42:25+00:00Added an answer on June 3, 2026 at 8:42 pm

    The code line you provided is incorrect. ValueMember of the combo box should be set to the name of the property or column that you want to be the value of your selected object (unique ID for example). But you are filling the ValueMember with the content of a field.

    When you bind the combo box in this way (setting the datasource with combination of DisplayMember and ValueMember), the SelectedValue property of the combo box is filled with the value of ValueMember field of the selected row.

    For example suppose that you have a DataTable with columns ActorID, Name and BirthDate with some data in it:

    DataTable dt = new DataTable();
    dt.Columns.Add("ActorID", typeof(int));
    dt.Columns.Add("Name", typeof(string));
    dt.Columns.Add("BirthDate", typeof(DateTime));
    
    
    dt.Rows.Add(1, "Will Smith", new DateTime(1968,9,25));
    dt.Rows.Add(2, "Bruce Willis", new DateTime(1955,3,19));
    dt.Rows.Add(3, "Jim Carrey", new DateTime(1962, 1, 17));
    dt.Rows.Add(18, "Nicole Kidman", new DateTime(1967,6,20));
    
    ComboBox cb = new ComboBox();
    cb.DropDownStyle = ComboBoxStyle.DropDownList;
    cb.Location = new Point(20, 100);
    cb.Width = 100;
    
    cb.DisplayMember = "Name";  // *****
    cb.ValueMember = "ActorID"; // ***** The important part
    cb.DataSource = dt;
    
    Button btn = new Button();
    btn.Text = "Show ID";
    btn.Location = new Point(10, 140);
    btn.Click += (sender, e) =>
        {
            MessageBox.Show(cb.SelectedValue.ToString()); // **** The other important part.
        };
    
    Form f = new Form();
    f.Controls.Add(cb);
    f.Controls.Add(btn);
    
    f.ShowDialog();
    

    When we read the SelectedValue of the combo box, it gets us the “ActorID” of the selected row.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm new here and I hope anyonte can help me. I have WCF Service
i'm new here and i have a question. I am trying to insert a
am new here. i have a slight problem; PLease look at the following code
I'm new around here and i have a little problems with a C# application.
I'm quite new here. I have a problem with the new iOS 5.1 slide-in
/edited/ I'm new here. I have a text file that reads: 6 <cr> R
I'm new here to stackoverflow, so bear with me. I have a book that
I'm new here and kinda new to java. I've encountered a problem. I have
Here I have a password field: /*********************PASSWORD**********************/ $password = new Zend_Form_Element_Password('password'); $alnumValidator = new
I have an almost new setup of ROR 3.1 here and have already generated

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.