title: How do I return a value to a sqldatareader if value is null?
body: <p>I am currently using a sql data reader (in vb.net) to extract an article object via a stored proc from a SQL Server 2008 database. Part of this object includes the two properties shown below:</p>
  
  <pre><code>theArticle.Truthfulness = ((myReader.GetInt32(myReader.GetOrdinal("Truthfulness"))))
  theArticle.Relevance = ((myReader.GetInt32(myReader.GetOrdinal("Relevance"))))
  </code></pre>
  
  <p>My problem is that the Truthfulness and Relevance may return a null value and this is causing the function to fall over.</p>
  
  <p>I think I understand why. I am asking for an integer value (getin32) and because null is returned it fails.</p>
  
  <p>How do I accommodate the null value from the database so it does not fall over?</p>