1

我刚上传了一个新版本的代码到我的服务器,并得到这个错误的错误,我不明白,不知道如何解决 - 我没有更改datetime2 - 我的代码语法中甚至没有这个词。 你知道这意味着什么吗?System.ArgumentException:正在使用的SQL Server版本不支持数据类型'datetime2

执行命令定义时发生错误。有关详细信息,请参阅内部例外:

InnerException:System.ArgumentException:正在使用的SQL Server版本不支持数据类型'datetime2'。

在System.Data.SqlClient.TdsParser.TdsExecuteRPC(_SqlRPC [] rpcArray,的Int32超时,布尔inSchema,SqlNotificationRequest通知请求,TdsParserStateObject stateObj,布尔isCommandProc)

在System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(的CommandBehavior cmdBehavior,RunBehavior runBehavior,布尔returnStream,布尔异步)

在System.Data.SqlClient.SqlCommand.RunExecuteReader(的CommandBehavior cmdBehavior,RunBehavior runBehavior,布尔returnStream,字符串方法,DbAsyncResult结果)

在System.Data.SqlClient.SqlCommand.RunExecuteReader(的CommandBehavior cmdBehavior,RunBehavior runBehavior,布尔returnStream,字符串方法)

在System.Data.SqlClient.SqlCommand.ExecuteReader(的CommandBehavior行为,字符串方法)

在系统.Data.SqlClient.SqlCommand.ExecuteDbDataReader(的CommandBehavior行为)

在System.Data.Common.DbCommand.ExecuteReader(的CommandBehavior行为)

在System.Data.EntityClient.EntityCommandDefinition.ExecuteStoreCommands(entityCommand entityCommand,的CommandBehavior BEHA vior

+0

对ef一无所知,你正在调用的任何机会在没有指定数据类型的情况下添加带参数的参数?方法的名称近似 – billinkc 2011-12-31 02:07:48

+0

可能的重复[使用SQL Server 2008和SQL Server 2005和日期时间](http://stackoverflow.com/questions/316422/using-sql-server-2008-and-sql-server-2005-和日期时间) – 2012-03-29 23:24:41

回答

7

事实证明,实体框架4莫名其妙地得到了主意,使用SQL Server 2008的修复是编辑XML编辑器中.edmx文件和设置的ProviderManifestToken="2005",而不是2008年。(你需要重建)

相关问题