API Questions on Kentico API.
Version 5.x > API > load document & node data View modes: 
User avatar
Member
Member
celeste - 10/17/2011 2:29:36 PM
   
load document & node data
I am trying to load the document data along with the node data, but I am not having any luck. I am getting only my document data. This is what I'm doing:

string codeName = "Test1.DocType1.customquery";
GeneralConnection cn = ConnectionHelper.GetConnection();
DataSet ds = cn.ExecuteQuery(codeName, parameters);
if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
{
TreeNode node = new TreeNode(ds.Tables[0].Rows[0], codeName, new TreeProvider(CMSContext.CurrentUser));
}
customquery is defined as:
SELECT ##COLUMNS## FROM View_Test1_DocType1_Joined WHERE [UniqueColumn] = @UniqueValue

The TreeNode correctly loads the data of my document type, but it does not load any data from the inherited document data or the node.

How can I get a complete TreeNode?

Thanks in advance

User avatar
Kentico Support
Kentico Support
kentico_radekm - 11/1/2011 3:55:58 AM
   
RE:load document & node data
Hello.

Could you please try to use CMS.WorkflowEngine.DocumentHelper.GetDocuments() method instead? It returns coupled data, too. When the method is used for more than one document type (className), DataSet contains corresponding number of tables.

Best Regards,
Radek Macalik