I developed an application using the
.NET Entity Framework and
SQL Server 2008 on my local machine. When I moved it onto the production server, which runs
SQL Server 2005, it threw this error as inner exception when trying to save a
DateTime:
The version of SQL Server in use does not support datatype ‘datetime2′.
The solution is changing a setting in the Entity Framework to target SQL Server 2005 instead of 2008. This setting is not available through the IDE, so:
- Open the *.edmx,
- Find the ProviderManifestToken attribute on the Schema tag,
- Change it's value from 2008 to 2005,
- A rebuild might be necessary.
No comments:
Post a Comment