title: How to cast selectedvalue of combobox to an integer?
body: <p>I have a combo box which was filled by datasource (value and id)</p>
  
  <pre><code>comboBox_Degree.DataSource = ds.Tables["Field"];`
  comboBox_Degree.DisplayMember = "Field_Degree";
  comboBox_Degree.ValueMember = "Field_ID";
  </code></pre>
  
  <p>now I want to retreive id when SelectedIndexChanged event occur. but when I cast it to an int I have such this error.</p>
  
  <pre><code>int fid = Convert.ToInt32(comboBox_Degree.SelectedValue.ToString());
  </code></pre>
  
  <p>error:</p>
  
  <blockquote>
    <p><em>Input string was not in a correct format.</em></p>
  </blockquote>
  
  <p>how can I cast this value to integer?</p>