使用的 SQL Server 版本不支持數據類型「datetime2」解決辦法

錯誤緣由,在使用ado.net entity的時候,entity使用的數據庫是sqlserver 2008,但後來實際使用中使用的數據庫是sqlserver 2005
使用的 SQL Server 版本不支持數據類型「datetime2」sql

The version of SQL Server in use does not support datatype ‘datetime2
解決辦法
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.數據庫

就是打開你的edmx文件,搜索ProviderManifestToken值,改成2005就ok~~~~~~~~~ide

 

另外還要把實體中的date類型改成datetime類型。datetime即能用於sqlServer2005,也能用於sqlServer2008sqlserver

 

轉載自:http://blog.csdn.net/soulzx/article/details/6756723.net

相關文章
相關標籤/搜索