title: Convert Textbox value to Integer
body: <p>I have the following Integer variables</p>
  
  <pre><code>Dim sMaxAmount As Integer
  Dim sMinAmount As Integer
  </code></pre>
  
  <p>I am trying to compare them with a TextBox field.</p>
  
  <pre><code>If (Convert.ToInt32(txtTransactionAmount) &lt; sMinAmount And Convert.ToInt32(txtTransactionAmount) &gt; sMaxAmount) Then
  </code></pre>
  
  <p>Although I am converting it to <code>Integer</code> I get exception</p>
  
  <blockquote>
    <p>Unable to cast object of type 'System.Web.UI.WebControls.TextBox' to
    type 'System.IConvertible'.</p>
  </blockquote>
  
  <p>What am I doing wrong?</p>