您的位置:首页 > 数据库

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.

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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐