title: I get the DateTime constructor's ArgumentOutOfRangeException when checking IsDBNull
body: <p>I have a ODBC data source, one of the columns is a DateTime. If I attempt to do anything with the field (<code>IsDbNull</code>,<code>GetValue</code>,<code>GetValues</code>) I will get an exception if the value is this databases equivalent of null.</p>
  
  <pre><code>System.ArgumentOutOfRangeException occurred
    HResult=-2146233086
    Message=Year, Month, and Day parameters describe an un-representable DateTime.
    Source=mscorlib
    StackTrace:
         at System.DateTime.DateToTicks(Int32 year, Int32 month, Int32 day)
         at System.DateTime..ctor(Int32 year, Int32 month, Int32 day, Int32 hour, Int32 minute, Int32 second)
         at System.Data.ProviderBase.DbBuffer.ReadDateTime(Int32 offset)
         at System.Data.Odbc.CNativeBuffer.MarshalToManaged(Int32 offset, SQL_C sqlctype, Int32 cb)
         at System.Data.Odbc.OdbcDataReader.internalGetDateTime(Int32 i)
         at System.Data.Odbc.OdbcDataReader.GetValue(Int32 i, TypeMap typemap)
         at System.Data.Odbc.OdbcDataReader.GetValue(Int32 i)
         at System.Data.Odbc.OdbcDataReader.IsDBNull(Int32 i)
         at Sandbox_Form.Form1.button1_Click(Object sender, EventArgs e) in e:\Code\Sandbox Form\Form1.cs:line 49
    InnerException: 
  </code></pre>
  
  <p>If I change my query to <code>select cast(First_Visit as varchar) as First_Visit_cast from Clients</code> I get the text string <code>0/0/0 12:00:00</code> returned as the result.</p>
  
  <p>Here is the snippet of my testing code. The first 17 rows work fine, however row 18 has that "null" valued date and throws the displayed exceptions.</p>
  
  <pre><code>const string Query = @"select cast(First_Visit as varchar) as First_Visit_cast
                               ,First_Visit 
                         from Clients";
  
  private void button1_Click(object sender, EventArgs e)
  {
      using (var con = new OdbcConnection("Dsn=My_ODBC_DSN"))
      {
          con.Open();
  
          using (var cmd = new OdbcCommand(Query, con))
          using (var rdr = cmd.ExecuteReader())
          {
              while (rdr.Read())
              {
                  var test = rdr.GetValue(0); //returns "0/0/0 12:00:00" as string.
  
                  var test3 = rdr.IsDBNull(1); //Throws an ArgumentOutOfRangeException: "Year, Month, and Day parameters describe an un-representable DateTime."
  
                  var test2 = rdr.GetValue(1); //Throws an ArgumentOutOfRangeException: "Year, Month, and Day parameters describe an un-representable DateTime."
  
                  var records = new object[rdr.FieldCount];
                  rdr.GetValues(records); //Throws an ArgumentOutOfRangeException: "Year, Month, and Day parameters describe an un-representable DateTime."
              }
          }
      }
  }
  </code></pre>
  
  <p>Is there any way to work around this? I really want to just write my query as <code>Select * from TableName</code> instead of identifying all of the DateTimes and explicitly casting them as strings.</p>