1

I have just uploaded a new version of code to my server and got this error bug that i cannot understand and don't know how to solve - I had no changes with datetime2 - I don't even have this word in my code syntax. Do you know what that means?

An error occurred while executing the command definition. See the inner exception for details:

InnerException: System.ArgumentException: The version of SQL Server in use does not support datatype 'datetime2'.

at System.Data.SqlClient.TdsParser.TdsExecuteRPC(_SqlRPC[] rpcArray, Int32 timeout, Boolean inSchema, SqlNotificationRequest notificationRequest, TdsParserStateObject stateObj, Boolean isCommandProc)

at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)

at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)

at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)

at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)

at System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior)

at System.Data.Common.DbCommand.ExecuteReader(CommandBehavior behavior)

at System.Data.EntityClient.EntityCommandDefinition.ExecuteStoreCommands(EntityCommand entityCommand, CommandBehavior behavior

2
  • Knowing nothing of ef, any chance you are calling add parameters with value without specifying data type? Name of method approximate Commented Dec 31, 2011 at 2:07
  • possible duplicate of Using SQL Server 2008 and SQL Server 2005 and date time Commented Mar 29, 2012 at 23:24

1 Answer 1

7

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.)

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.