Error: the version of SQL Server in use does not support datatype 'datetime2

Source: Internet
Author: User

I 've built a Entity Framework Model against a 2008 database. All works OK against the 2008 database. When I try to update the entity on a 2005 database I get this error.

 
The version of SQL Server in use does not support datatype 'datetime2

I specifically did not use any 2008 features when I built the database. I can't find any reference to datetime2 in the code. and, yes the column is defined as "datetime" in the database.

 

Answer:

A quick Google points me to what looks like the solution.

Open your edmx in a file editor (or "open ..." In Visual Studio and select XML editor ). at the top you will find the storage model and it has an attribute providermanifesttoken. this has shoshould have the value 2008. change that to 2005, recompile and everything works.

<Schema namespace = "foobar. Store" alias = "self" provider = "system. Data. sqlclient" providermanifesttoken = "2005">
 
 
From link: http://stackoverflow.com/questions/316422/using-sql-server-2008-and-sql-server-2005-and-date-time
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.