title: Object cannot be cast from DBNull to other types using DBNull.Value ? Convert
body: <p>I am trying to read the values out of a database that I am aware is null in the criteria I am looking for right now.
  So I had this method of checking for that: <code>ld.Percentage = reader["DataWin3Data"] != DBNull.Value ? Convert.ToDouble(reader["DataWin3Data"]) : double.MinValue;</code> 
  I have used it before where a field can be null and it hasn't had a problem. I am not totally sure what to do in this situation as to how to fix it. I have included my relevant code below. How can change what I am doing currently to not have have this error when there is a null value?</p>
  
  <pre><code>ld.Percentage = reader["DataWin3Data"] != DBNull.Value ? Convert.ToDouble(reader["DataWin3Data"]) : double.MinValue;
  ld.TotalCases = reader["DataWin8Data"] != DBNull.Value ? Convert.ToInt32(reader["DataWin8Data"]) : int.MinValue;
  ld.TotalPercentage = reader["DataWin7Data"] != DBNull.Value ? Convert.ToDouble(reader["DataWin7Data"]) : double.MinValue;
  </code></pre>