title: SelectedValue for ComboBox not getting set
body: <p>I have comboBox name as <code>cmbContactType</code>. I binded this combo with dataSource as DisplayMember <code>ValueName</code>(string type) and valueMember as <code>ValueID</code>(number type). When user change value in cmbContactType then cmbContactType.SelectValue get set and I am able to save document with this Selectedvalue. I facing problem while setting cmbContactType value from database which is of type number. Every time I am trying to set value, <code>null</code> value set to the <code>cmbContactType.SelectValue</code>.
  Following is the code by which I am binding datasource to <code>cmbContactType</code> and for setting SelectedValue of <code>cmbContactType</code>. I am using VS2010 and MS-Access. Please help.</p>
  
  <pre><code>    //method to bind dataSource.
      public static void BindDataSourceWithCombo(ref ComboBox cmb, string query, string valueMember, string displayMember)
      {
          DataTable _tableSource = (new AccessConnectionManager()).GetDataTableBySQLQuery(query);
  
          var _dataSource = (from DataRow _row in _tableSource.Rows
                             select new
                             {
                                 ValueMember = _row[valueMember],
                                 DisplayMember = _row[displayMember].ToString()
  
                             }).ToList();
  
          cmb.DisplayMember = "DisplayMember";
          cmb.ValueMember = "ValueMember";
          cmb.DataSource = _dataSource;
      }
  
      // Method to set values in document.
      public void SetDocumentProperties()
      {
          string _query = string.Format("Select ContactCode,ContactName,ContactType from ContactMaster where ContactCode = '{0}'", Convert.ToString(cmbContactCode.Text));
          DataTable _table = AccessConnectionManagers.GetDataTableBySQLQuery(_query);
  
          if (_table.Rows.Count &gt; 0)
          {
              DataRow _row = _table.Rows[0];
              txtContactCode.Text = Convert.ToString(_row["ContactCode"]);
              txtContactName.Text = Convert.ToString(_row["ContactName"]);
              cmbContactType.SelectedValue = _row["ContactType"];
          }
          else
          {
              txtContactCode.Text = string.Empty;
              txtContactName.Text = string.Empty;
              cmbContactType.SelectedValue = 1;
          }
      }
  </code></pre>
  
  <p>Here is code by which I bind dataSource with cmbConactType. This method call on Form_Load event.</p>
  
  <pre><code>    private void LoadContactTypeCombo()
      {
          //Table: PicklistValues(ID,MasterID,ValueID,ValueName) 
          string _query = string.Format("select ValueID,ValueName from PicklistValues where MasterID = {0}", 1);
          BindDataSourceWithCombo(ref cmbContactType, _query, "ValueID", "ValueName");
      }
  </code></pre>