In an ASP.NET 4.0 Web Form, I'm using the Entity Framework 4.0.
On the test server, everything is in order. However, same mistake is recorded by my Elmah when I reach the production server.
The version of SQL Server in use does not support datatype 'datetime2'.
I quickly looked into this and discovered that
the issue and environment
will find a solution.
This is my issue. My Production Server has SQL Server Express 2008, whereas my Development Server has Data Warehouse 2008 R2. So it doesn't seem appropriate to change the manifest to 2005.
My inquiries are
datetime2if I haven't used it in any of the tables at all?
I have yet to come across a solution. Therefore, if you're using SQL Server Express 2008, please right-click on your edmx file, open it in an XML (Text) Editor, and set
Not that nice of a sound. But for now, it is all I have.
The solution provided in this blog article, The current version of SQL Server does not support the datetime2 datatype., seems to work for me.
It turns out that Entity Framework 4 somehow got the idea to use SQL Server 2008. The fix was to edit the .edmx file in an XML editor and set the ProviderManifestToken="2005" instead of 2008. (You need to rebuild.) Hereâ€™s how the line should look against SQL Server 2005:
<Schema Namespace="OfficeBookDBModel.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">