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

当刚点的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%22
xmlns=”http://schemas.microsoft.com/ado/2009/02/edm/ssdl%22>

 

改为

 

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

即可

相关文章