title: if combo box selected item is null how do I assign an empty string to it instead? vb.net
body: <p>I have a property called ReplacementTo</p>
  
  <p>and I set a value to it based on the selecteditem from the combobox, like this:</p>
  
  <pre><code>classEquipmentItem.ReplacementTo = cmbReplcmnt.SelectedItem.ToString
  </code></pre>
  
  <p>Now I can't use cmbReplcmnt.Text because what I actually need is the value of that SelectedItem</p>
  
  <p>So problem is, if the user leaves the combobox as blank, it throws a null exception.
  I decided to use the IIf function then:</p>
  
  <pre><code>classEquipmentItem.ReplacementTo = IIf(IsNothing(cmbReplcmnt.SelectedItem.ToString), classEquipmentItem.ReplacementTo = "", cmbReplcmnt.SelectedItem.ToString)
  </code></pre>
  
  <p>Unfortunately I still get the error</p>
  
  <p>I tried using a Try-Catch for it and it worked, but I don't want to rely on the Try-Catch, so I was wondering is there a another way to work this through?</p>