title: 'Cannot bind to the new value member. Parameter name: newDisplayMember'.
body: <p>I'm  using C# in Visual Studio 2010. I have 2 comboboxes that pull data from the database. The code looks something like this:</p>
  
  <pre><code>        cbo1.DisplayMember = "Name";
          cbo1.ValueMember = "HROfficeLocationID";
          cbo1.DataSource = offices;
          cbo2.DisplayMember = "Name";
          cbo2.ValueMember = "HROfficeLocationID";
          cbo2.DataSource = offices;
  </code></pre>
  
  <p>I kept getting this exception: 'Cannot bind to the new value member. Parameter name: newDisplayMember'. I searched around and then reorganized the lines of code so that cbo.DataSource came before .DisplayMember and .ValueMember .It ended up looking something like this:</p>
  
  <pre><code>       cbo1.DataSource = offices;
         cbo1.DisplayMember = "Name";
         cbo1.ValueMember = "HROfficeLocationID";
         cbo2.DataSource = offices;
         cbo2.DisplayMember = "Name";
         cbo2.ValueMember = "HROfficeLocationID";
  </code></pre>
  
  <p>The exception went away. Just thought I'd share.</p>