title: Checking range for textboxes
body: <p>I have 2 textboxes on my form for which I'm trying to restrict the input. Here is a more detailed description of what I'm trying to do:</p>
  
  <p>Code a method named <code>IsValidData</code> that checks that the Operand 1 and Operand 2 text boxes contain a decimal value between 0 and 1,000,000 (non-inclusive) and that the Operator text box contains a valid operator.</p>
  
  <p>I know the way that I did this is wrong but I'm not sure how to fix it. The way I thought of it when writing the if statement is this: </p>
  
  <p>check to make sure the value is >0 AND &lt;=100 for the input in the <code>txtOperand1</code> textbox and then did the same for the other textbox. Can someone please give suggestions on what I'm doing wrong? Thanks.</p>
  
  <pre><code>double operand1 = Convert.ToDouble(txtOperand1.Text);
  double operand2 = Convert.ToDouble(txtOperand2);
  
  
          if ((operand1 &gt; 0 &amp;&amp; operand1 &lt;= 100) &amp;&amp;
              (operand2 &gt; 0 &amp;&amp; operand2 &lt;= 100))
              return true;
  </code></pre>