您的位置:首页 > 数据库

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

2010-07-19 12:05 751 查看
在刚接触的MVC2 Sample(NerdDinner)中,我把SQL2008的数据库转为SQL2005后

出现了

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

其问题产生的原因是SQL2005没有该数据类型 datetime2

然后GOOGLE一翻找到答案

发生这个问题的主要原因是*.edmx中可以设置一个数据库版

<Schema Namespace="NerdDinnerModel.Store" Alias="Self" Provider="System.Data.SqlClient" ProviderManifestToken="2008" xmlns:store="http://schemas.microsoft.com/ado/2007/12/edm/EntityStoreSchemaGenerator" xmlns="http://schemas.microsoft.com/ado/2009/02/edm/ssdl">

改为

<Schema Namespace="NerdDinnerModel.Store" Alias="Self" Provider="System.Data.SqlClient" ProviderManifestToken="2005" xmlns:store="http://schemas.microsoft.com/ado/2007/12/edm/EntityStoreSchemaGenerator" xmlns="http://schemas.microsoft.com/ado/2009/02/edm/ssdl">

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