Error: The version of SQL Server in use does not support datatype 'datetime2
2011-10-13 09:39
1176 查看
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.
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 with…” in Visual Studio and select XML Editor). At the top you will find the storage model and it has an attribute ProviderManifestToken. This has should have the value 2008. Change that to 2005, recompile and everything works.
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 with…” in Visual Studio and select XML Editor). At the top you will find the storage model and it has an attribute ProviderManifestToken. This has should 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
相关文章推荐
- Error: The version of SQL Server in use does not support datatype 'datetime2'
- ERROR: The version of SQL Server in use does not support datatype 'datetime2'.
- The version of SQL Server in use does not support datatype 'datetime2'.
- ADO.NET Entity Framework: The version of SQL Server in use does not support datatype 'datetime2'
- 海洋工作室——网站建设专家:The version of SQL Server in use does not support datatype datetime2 and the Entity Framework.
- HOW TO: Change the Owner of a User-Defined Data Type That Is in Use in SQL Server 2000
- JAVA+ Proxool+ SQLserver 2008 “signer information does not match signer information of other classes in the same package”
- Could not store transport type data for Receive Location 'Recv.Loc' to config store. Primary SSO Server 'Sql-server' failed. The external credentials in the SSO database are more recent.
- The server does not support version 3.1 of the JEE Web module specification.
- The server does not support version 3.1 of the JEE Web module specification.
- Fix the error of ""Server does not support secure connections. " ?" when sending email
- The server does not support version 3.1 of the JEE Web module specification.
- [Solved]: System.Data.SqlClient.SqlError: Exclusive access could not be obtained because the database is in use.
- SQL Server setup media does not support the language of the OS or does not have ENU localized files.
- SQL Server setup media does not support the language of the OS or does not have ENU localized files.
- You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near
- Description Resource Path Location Type Java compiler level does not match the version of the in解决方法
- This EntitySet of Type 'Data.Tbl_Student' does not support the 'Add' operation.原因
- Description Resource Path Location Type Java compiler level does not match the version of the in...
- The current .NET SDK does not support targeting .NET Core 2.1. Either target .NET Core 2.0 or lower, or use a version of the .NET SDK that supports .NET Core 2.1.