title: ComboBox data binding does not work using DataReader
body: <p>Some of you may think it has already been solved somewhere else in this community, but I cannot really get around of it. 
  I have a ComboBox and I like it to be populated using DataReader. As usual, I have created a Class to get-set <code>value member</code> and <code>display member</code>. My code goes below.</p>
  
  <pre><code>using (MySqlCommand cmd = new MySqlCommand("SELECT item_id, item_name FROM items WHERE status='active'", Class_Connection.conn))
          {
              MySqlDataReader rdr = cmd.ExecuteReader();
              ArrayList temptbl = new ArrayList();
              while (rdr.Read())
              {
                  //MessageBox.Show(rdr.GetString(1).ToString() + "::" + rdr.GetString(0).ToString());
                  temptbl.Add(new Class_NameValue(rdr.GetString(1), rdr.GetString(0)));
              }
              rdr.Close();
  
              // define Display and Value members
              cmb_items.DisplayMember = "NameMember";
              cmb_items.ValueMember = "IdMember";
              // set the DataSource to the DataTable 
              cmb_items.DataSource = new BindingSource(temptbl, null); 
          }
  </code></pre>
  
  <p>The Get-Set Class is below:</p>
  
  <pre><code>class Class_NameValue
  {
      private string myNameMember;
      private string myValueMember;
  
      public Class_NameValue(string strNameMember,string stringValueMember)
      {
          this.myNameMember = strNameMember;
          this.myValueMember = stringValueMember;
  
  
      }
      public string NameMember
      {
          get
          {
              return myNameMember;
          }
      }
      public string IdMember
      {
          get
          {
              return myValueMember;
          }
      }
  }
  </code></pre>
  
  <p>The code compiles ok. But when the application runs, it gives an error 
  "<code>Cannot bind to the new display member.Parameter name: newDisplayMember</code>"</p>
  
  <p>Whats wrong with my code? Can anybody help please?</p>
  
  <p>Thanks in advance.</p>