ap
hello. when i attempt to use:
CategoryInfoProvider.GetDocumentCategories
such as:
DataSet ds1 = CategoryInfoProvider.GetDocumentCategories("CategoryId=123", null, 0);
OR
DataSet ds1 = CategoryInfoProvider.GetDocumentCategories("CategoryId=123", "", 0);
it throws an error:
[DataConnection.HandleError]: Query: WITH AllData (CategoryID, CategoryDisplayName, CategoryName, CategoryCount, CategoryNamePath, CategoryIDPath, CategoryUserID, CategorySiteID, CategoryParentID)
AS
(
SELECT CMS_Category.CategoryID, CMS_Category.CategoryDisplayName, CMS_Category.CategoryName, count(DocumentID) as CategoryCount, CMS_Category.CategoryNamePath, CMS_Category.CategoryIDPath, CMS_Category.CategoryUserID, CMS_Category.CategorySiteID, CMS_Category.CategoryParentID
FROM CMS_Category INNER JOIN CMS_DocumentCategory ON CMS_Category.CategoryID = CMS_DocumentCategory.CategoryID WHERE (DocumentID IN (SELECT DocumentID FROM View_CMS_Tree_Joined WHERE CategoryID=123
GROUP BY CMS_Category.CategoryID, CMS_Category.CategoryDisplayName, CMS_Category.CategoryName, CMS_Category.CategoryNamePath, CMS_Category.CategoryIDPath, CMS_Category.CategoryUserID, CMS_Category.CategorySiteID, CMS_Category.CategoryParentID
)
SELECT CategoryID, CategoryDisplayName, CategoryName, CategoryCount, CategoryNamePath, CategoryIDPath, CategoryUserID, CategorySiteID, CategoryParentID
FROM AllData AS cats
WHERE NOT EXISTS (SELECT CategoryID FROM AllData WHERE CategoryParentID = cats.CategoryID)
: caused exception: Incorrect syntax near the keyword 'SELECT'.
however if i use:
DataSet ds1 = CategoryInfoProvider.GetDocumentCategories(xNode.DocumentID, "CategoryIDPath LIKE '/00001315/%'", null, 0, "CMS_Category.CategoryID, CategoryIDPath");
it works fine.
Thanks for your help.
hello. when i attempt to use:
CategoryInfoProvider.GetDocumentCategories
such as:
DataSet ds1 = CategoryInfoProvider.GetDocumentCategories("CategoryId=123", null, 0);
OR
DataSet ds1 = CategoryInfoProvider.GetDocumentCategories("CategoryId=123", "", 0);
it throws an error:
[DataConnection.HandleError]: Query: WITH AllData (CategoryID, CategoryDisplayName, CategoryName, CategoryCount, CategoryNamePath, CategoryIDPath, CategoryUserID, CategorySiteID, CategoryParentID)
AS
(
SELECT CMS_Category.CategoryID, CMS_Category.CategoryDisplayName, CMS_Category.CategoryName, count(DocumentID) as CategoryCount, CMS_Category.CategoryNamePath, CMS_Category.CategoryIDPath, CMS_Category.CategoryUserID, CMS_Category.CategorySiteID, CMS_Category.CategoryParentID
FROM CMS_Category INNER JOIN CMS_DocumentCategory ON CMS_Category.CategoryID = CMS_DocumentCategory.CategoryID WHERE (DocumentID IN (SELECT DocumentID FROM View_CMS_Tree_Joined WHERE CategoryID=123
GROUP BY CMS_Category.CategoryID, CMS_Category.CategoryDisplayName, CMS_Category.CategoryName, CMS_Category.CategoryNamePath, CMS_Category.CategoryIDPath, CMS_Category.CategoryUserID, CMS_Category.CategorySiteID, CMS_Category.CategoryParentID
)
SELECT CategoryID, CategoryDisplayName, CategoryName, CategoryCount, CategoryNamePath, CategoryIDPath, CategoryUserID, CategorySiteID, CategoryParentID
FROM AllData AS cats
WHERE NOT EXISTS (SELECT CategoryID FROM AllData WHERE CategoryParentID = cats.CategoryID)
: caused exception: Incorrect syntax near the keyword 'SELECT'.
however if i use:
DataSet ds1 = CategoryInfoProvider.GetDocumentCategories(xNode.DocumentID, "CategoryIDPath LIKE '/00001315/%'", null, 0, "CMS_Category.CategoryID, CategoryIDPath");
it works fine.
Thanks for your help.