I upgraded a site from Kentico 8.1 all of the way up to Kentico 10. it is now showing the following error:
Message: [CMSAbstractTransformation.DataBind]:
SELECT *
FROM View_CMS_Tree_Joined AS V WITH (NOLOCK, NOEXPAND) LEFT OUTER JOIN COM_SKU AS S WITH (NOLOCK) ON [V].[NodeSKUID] = [S].[SKUID]
WHERE [NodeAliasPath] = @NodeAliasPath AND [DocumentCulture] = @DocumentCulture
Caused exception:
Conversion failed when converting the nvarchar value '/' to data type int.
Exception type: System.Exception
Message:
SELECT *
FROM View_CMS_Tree_Joined AS V WITH (NOLOCK, NOEXPAND) LEFT OUTER JOIN COM_SKU AS S WITH (NOLOCK) ON [V].[NodeSKUID] = [S].[SKUID]
WHERE [NodeAliasPath] = @NodeAliasPath AND [DocumentCulture] = @DocumentCulture
Caused exception:
Conversion failed when converting the nvarchar value '/' to data type int.
Exception type: System.Exception
Stack trace:
at CMS.DataEngine.AbstractDataConnection.HandleError(String queryText, Exception ex)
at CMS.DataEngine.AbstractDataConnection.ExecuteQuery(String queryText, QueryDataParameters queryParams, QueryTypeEnum queryType, Boolean requiresTransaction)
at CMS.DataEngine.GeneralConnection.RunQuery(QueryParameters query)
at CMS.DataEngine.GeneralConnection.RunQueryWithRetry(QueryParameters query, Int32 retryCount)
at CMS.DataEngine.GeneralConnection.ExecuteQuery(QueryParameters query, Int32& totalRecords)
at CMS.DataEngine.DataQueryBase1.GetDataFromDBInternal()
at CMS.DataEngine.DataQueryBase
1.GetDataFromDB()
at CMS.DataEngine.DataQueryBase1.GetData()
at CMS.DataEngine.DataQueryBase
1.get_Result()
at CMS.DataEngine.ObjectQueryBase2.GetResults(IDataQuery query, Int32& totalRecords)
at CMS.DataEngine.DataQueryBase
1.GetDataFromDB()
at CMS.DocumentEngine.DocumentQueryProperties.GetDataInternal(IDocumentQuery query, Func1 baseGetDataMethod, Action
1 setTotalRecords)
at CMS.DataEngine.DataQueryBase1.GetData()
at CMS.DataEngine.ObjectQueryBase
2.GetData()
at CMS.DocumentEngine.DocumentQueryBase2.GetData()
at CMS.DataEngine.DataQueryBase
1.get_Result()
at CMS.DataEngine.DataQueryBase1.GetResults(IDataQuery query, Int32& totalRecords)
at CMS.DataEngine.DataQueryBase
1.GetDataFromDB()
at CMS.DocumentEngine.DocumentQueryProperties.GetDataInternal(IDocumentQuery query, Func1 baseGetDataMethod, Action
1 setTotalRecords)
at CMS.DataEngine.DataQueryBase1.GetData()
at CMS.DataEngine.DataQueryBase
1.get_Result()
at CMS.DataEngine.MultiObjectQueryBase3.EnsureTypedResult()
at CMS.DataEngine.MultiObjectQueryBase
3.System.Collections.IEnumerable.GetEnumerator()
at CMS.DataEngine.EnumerableWrapper1.-GetEnumerator>d__5.MoveNext()
at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable
1 source)
at System.Linq.EnumerableExecutor1.ExecuteBoxed()
at CMS.DataEngine.CMSQueryProvider
1.Execute[TResult](Expression expression)
at CMS.Controls.KTTransformations.pageCategory(Object NodeID) in E:\inetpub\wwwroot\ktintranet\CMS\App_Code\KTIntra\Classes\TransformationMethods.cs:line 80
at ASP.cmsvirtualfiles_transformations_kt_product_partssearchsuggestionsjson_ascx.__DataBind__control2(Object sender, EventArgs e) in E:\inetpub\wwwroot\ktintranet\CMS\CMSVirtualFiles\Transformations\KT.Product\PartsSearchSuggestionsJSON.ascx:line 2
at System.Web.UI.Control.OnDataBinding(EventArgs e)
at System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding)
at System.Web.UI.Control.DataBindChildren()
at System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding)
at CMS.DocumentEngine.Web.UI.CMSAbstractTransformation.DataBind()
Message: Conversion failed when converting the nvarchar value '/' to data type int.
Exception type: System.Data.SqlClient.SqlException
Stack trace:
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
at System.Data.SqlClient.SqlDataReader.TryHasMoreRows(Boolean& moreRows)
at System.Data.SqlClient.SqlDataReader.TryReadInternal(Boolean setTimeout, Boolean& more)
at System.Data.SqlClient.SqlDataReader.Read()
at System.Data.Common.DataAdapter.FillLoadDataRow(SchemaMapping mapping)
at System.Data.Common.DataAdapter.FillFromReader(DataSet dataset, DataTable datatable, String srcTable, DataReaderContainer dataReader, Int32 startRecord, Int32 maxRecords, DataColumn parentChapterColumn, Object parentChapterValue)
at System.Data.Common.DataAdapter.Fill(DataSet dataSet, String srcTable, IDataReader dataReader, Int32 startRecord, Int32 maxRecords)
at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet)
at CMS.DataEngine.AbstractDataConnection.ExecuteQuery(String queryText, QueryDataParameters queryParams, QueryTypeEnum queryType, Boolean requiresTransaction)
Event URL:
/Special-Pages/Parts-Search-Suggestions.aspx?searchtext=Bakery%20case%20cover&searchmode=anyword
URL referrer:
http://Ktintranet/Store-Engineering-Parts-Ordering/Frequently-Ordered-Parts.aspx
User agent:
Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; Trident/7.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET4.0C; .NET4.0E)
The contents of E:\inetpub\wwwroot\ktintranet\CMS\CMSVirtualFiles\Transformations\KT.Product\PartsSearchSuggestionsJSON.ascx:
`<%# If(DataItemIndex == 0, "[", "") %><%# If(DataItemIndex != 0, ",", "") %><%# "{\"id\":\""+GetSearchValue("DocumentID")+"\",\"label\":\""+CMS.Controls.KTTransformations.formatStringLength(GetSearchValue("SKUNumber").ToString(), 8, "", ' ')+" "+CMS.Controls.KTTransformations.formatStringLength(GetSearchValue("SKUShortDescription").ToString(), 30, "...", ' ')+" "+CMS.Controls.KTTransformations.formatStringLength(CMS.Controls.KTTransformations.pageCategory(GetSearchValue("NodeID")), 20, "...", ' ')+"\",\"value\":\""+GetDocumentUrl(GetSearchValue("DocumentID"))+"\"}" %><%# If(DataItemIndex == DataItemCount-1, "]", "") %>`
Any Ideas of what could be causing the error?