title: Entity Framework Error - The version of SQL Server in use does not support datatype 'datetime2'
body: <p>I am using Entity Framework 4.0 in an ASP.NET 4.0 Web Form.</p>
  
  <p>All is fine on the development server. But when I get to the production server, I my Elmah logs this error</p>
  
  <blockquote>
    <p>System.ArgumentException<br>
    The version of SQL Server in use does not support
    datatype 'datetime2'.</p>
  </blockquote>
  
  <p>I did a quick research and found out that <code>datetime2</code> aka <code>datetime2(7)</code> is the problem and setting <code>ProviderManifestToken="2005"</code> will solve the issue. </p>
  
  <p>My problem is this. My Development Server has <strong>SQL Server 2008 R2</strong> and Production Server has <strong>SQL Server 2008 Express</strong>. So, changing the manifest to 2005 doesn't seem right.</p>
  
  <p>My questions are</p>
  
  <ol>
  <li>Will setting <code>ProviderManifestToken="2005"</code> work?</li>
  <li>Why has Entity Framework generated a <code>datetime2</code> when I haven't used it at all in any of the table?</li>
  <li>Is there a better work around?</li>
  </ol>