title: Why ever cast reference types when you can use "as"?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/2483/casting-newtype-vs-object-as-newtype">Casting: (NewType) vs. Object as NewType</a>  </p>
  </blockquote>
  
  
  
  <p>In C#, why ever cast reference types when you can use "as"?  </p>
  
  <p>Casting can generate exceptions whereas "as" will evaulate to <code>null</code> if the casting fails.</p>
  
  <p>Wouldn't "as" be easier to use with reference types in all cases?</p>
  
  <p>eg:</p>
  
  <pre><code>MyObject as DataGridView
  </code></pre>
  
  <p>rather than,</p>
  
  <pre><code>(DataGridView)MyObject
  </code></pre>