Converting from DateTime to SqlDateTime is inaccurate
<p>I have a method that gets a date property from a source (either a <code>DataRow</code> or a <code>SqlDataReader</code>):</p>

<pre><code>protected SqlDateTime GetSqlDateTimePropertyValue(string propertyName, object source)
{
  var objValue = GetPropertyValue(propertyName, source);
  var value = objValue == DBNull.Value ? null : (DateTime?)objValue;
  var sqlValue = new SqlDateTime();
  if (value.HasValue) sqlValue = value.Value;
  return sqlValue;
}
</code></pre>

<p>but the conversion appears to be changing the date slightly so that my test always fails.</p>

<p>Does anyone know why this method would be converting wrongly? </p>

<p>At the end of the method, it looks like the conversion to <code>SqlDateTime</code> does some rounding:</p>

<pre><code>value.Value.Ticks:        634698391707468296
sqlValue.Value.Ticks:     634698391707470000
</code></pre>
