Don't miss out Virtual Happy Hour this Friday (April 26).

Try our conversational search powered by Generative AI!

Must declare the scalar variable "@ID".

Vote:
 

I've just deployed some code and database to a new server and I'm getting a YSOD. The code works fine on all the development workstations it's installed on and on two other servers that it has been deployed to.

I'm using CMS 6.0.530.0 on Windows 2003 R2 64Bit with SQL 2005 SP3 64Bit.

The error is as follows. Any ideas?

 

Server Error in '/' Application.

Must declare the scalar variable "@ID".

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: Must declare the scalar variable "@ID".

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


Stack Trace:

[SqlException (0x80131904): Must declare the scalar variable "@ID".]
   System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) +212
   System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +245
   System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +2811
   System.Data.SqlClient.SqlDataReader.ConsumeMetaData() +87
   System.Data.SqlClient.SqlDataReader.get_MetaData() +112
   System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +2476580
   System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) +2478113
   System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) +424
   System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) +28
   System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) +211
   System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior) +19
   System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader() +21
   EPiServer.Data.Dynamic.Providers.DbDataStoreProvider.LoadReferencesAndCollections(ProviderCallContext ctx) +268
   EPiServer.Data.Dynamic.Providers.DbDataStoreProvider.LoadObject(ProviderCallContext context) +169
   EPiServer.Data.Dynamic.Providers.<>c__DisplayClass1`1.<Execute>b__0() +183
   EPiServer.Data.Dynamic.Providers.DbDataStoreProvider.InternalExecute(Func`1 method) +179
   EPiServer.Data.Dynamic.Providers.DbDataStoreProvider.Execute(Func`1 action) +272
   EPiServer.Data.Dynamic.DynamicDataStore.InternalLoad(Identity id, Type type, LoadAsObjectType loadAs, ProviderCallContext parentContext) +770
   EPiServer.Data.Dynamic.EPiServerDynamicDataStore.Load(Identity id) +66
   EPiServer.Data.Dynamic.DynamicDataCollectionEnumerator.get_Current() +362
   System.Linq.Enumerable.FirstOrDefault(IEnumerable`1 source) +342
   EPiServer.TaskManager.TaskManager.get_TaskManagerData() +657
   EPiServer.TaskManager.TaskManager.GetDivergenceTimeWithPreviousJob() +38
   EPiServer.TaskManager.TaskManager.Run() +129
   EPiServer.Web.InitializeEngine.Initialize() +663
   EPiServer.Web.InitializationModule.StaticInitialization() +1904
   EPiServer.Web.InitializationModule.Initialize(InitializationEngine context) +49
   EPiServer.Framework.Initialization.InitializationEngine.InitializeModules() +853
   EPiServer.Framework.Initialization.InitializationEngine.Initialize(HostType hostType) +115
   EPiServer.Framework.Initialization.InitializationModule.StaticInitialization(HostType hostType) +227
   EPiServer.Framework.Initialization.InitializationModule.Application_BeginRequest(Object sender, EventArgs e) +348
   System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +80
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +171



Version Information: Microsoft .NET Framework Version:2.0.50727.3615; ASP.NET Version:2.0.50727.3618 

 

#45725
Nov 15, 2010 12:48
Vote:
 

I'd check that the collation of the SQL Server matches the one you exported from (where it works).

#45737
Nov 15, 2010 16:15
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.