An error occurred while executing the command definition. See the inner exception for details. bbbbInnerException:aaaa 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
Tengo un sitio web que utiliza Entity Framework. Hace unos meses, agregué una nueva tabla y agregué algunas columnas a las tablas existentes; todo funcionó bienLa versión de SQL Server en uso no admite el tipo de datos datetime2?
Hoy actualicé la asignación del EDMX para que se puedan usar la nueva tabla y la nueva columna, y agregué WebMethods a mi archivo services.asmx. Desde entonces no puedo ejecutar mi sitio porque tengo ese error que no puedo entender. Por favor explícamelo si entiendes, y dime dónde está mi error.
No he usado datetime2 en cualquier lugar. No hay tal tipo de datos en mi nueva tabla, ni en las columnas que agregué a las tablas existentes.
La versión de SQL en mi PC es SQL2008 R2, en el servidor tengo SQL2008. No tengo la opción de actualizar el servidor a R2.
¿Está utilizando un procedimiento CLR? – Milee
[Datetime2] (http://msdn.microsoft.com/en-us/library/bb677335%28v=sql.100%29.aspx) existía en SQL 2008 de todos modos, por lo que creo que la actualización a R2 en el servidor wouldn No te ayudo de todos modos. – Bridge
Eche un vistazo al nivel de compatibilidad de su base de datos (propiedades-> opciones), ¿es también SQL Server 2008? – Wim