title: Can you use cmd.ExecuteScalar when the sproc uses RETURN @value
body: <p>Can you use </p>
  
  <pre><code>int blah = Convert.ToInt32(cmd.ExecuteScalar());
  </code></pre>
  
  <p>When the sproc's last statement does:</p>
  
  <pre><code>RETURN @value
  </code></pre>
  
  <p>I can only get it to work if it does:</p>
  
  <p>SELECT @value</p>
  
  <p>Also, this gives me a object null exception:</p>
  
  <pre><code>int blah = (int)cmd.ExecuteScalar();
  </code></pre>
  
  <p>isn't convert.toint32 and (int) the same thing but one is a wrapper of the other?</p>