Pages/Search - SQL Search exception thrown

SOS Childrensvillages asked on March 31, 2021 11:25

When searching certain words/phrases (no special chars or anything like that) on the pages module with the SQL search the below exception gets thrown. I found an old question on this from 2010 but the link to the workaround is dead.

<target>.Category and <source>.Category have conflicting properties: DataType property mismatch.
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.DataException: <target>.Category and <source>.Category have conflicting properties: DataType property mismatch.

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:


[DataException: \<target>.Category and <source>.Category have conflicting properties: DataType property mismatch.]
   System.Data.DataSet.RaiseMergeFailed(DataTable table, String conflict, MissingSchemaAction missingSchemaAction) +2396063
   System.Data.Merger.MergeSchema(DataTable table) +1022
   System.Data.Merger.MergeTableData(DataTable src) +33
   System.Data.Merger.MergeDataSet(DataSet source) +502
   System.Data.DataSet.Merge(DataSet dataSet, Boolean preserveChanges, MissingSchemaAction missingSchemaAction) +212
   System.Data.DataSet.Merge(DataSet dataSet) +92
   CMS.SearchProviderSQL.SearchProvider.Search(String siteName, String searchNodePath, String cultureCode, String searchExpression, SearchModeEnum searchMode, Boolean searchChildNodes, String classNames, Boolean filterResultsByReadPermission, Boolean searchOnlyPublished, String whereCondition, String orderBy, Boolean combineWithDefaultCulture) +1882
   CMS.DocumentEngine.TreeProvider.Search(String siteName, String searchNodePath, String cultureCode, String searchExpression, SearchModeEnum searchMode, Boolean searchChildNodes, String classNames, Boolean filterResultsByReadPermission, Boolean searchOnlyPublished, String whereCondition, String orderBy, Boolean combineWithDefaultCulture) +514
   CMS.DocumentEngine.Web.UI.CMSSearchResults.ReloadData(Boolean forceLoad) +2499
   System.Web.UI.Control.LoadRecursive() +68
   System.Web.UI.Control.LoadRecursive() +162
   System.Web.UI.Control.LoadRecursive() +162
   System.Web.UI.Control.LoadRecursive() +162
   System.Web.UI.Control.LoadRecursive() +162
   System.Web.UI.Control.LoadRecursive() +162
   System.Web.UI.Control.LoadRecursive() +162
   System.Web.UI.Control.LoadRecursive() +162
   System.Web.UI.Control.LoadRecursive() +162
   System.Web.UI.Control.LoadRecursive() +162
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3785

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.7.3770.0

Correct Answer

Juraj Ondrus answered on April 1, 2021 06:57

It seems that in your project you have several page types with common field names, but in each the data type for the field is different. And this is the cause of the issue. This article describes similar issue and I would recommend to find those fields and either use the same data type or use unique field names.

0 votesVote for this answer Unmark Correct answer

   Please, sign in to be able to submit a new answer.