Bug reports Found a bug? Post it here please.
Version 4.x > Bug reports > TreeProvider.SelectNodes method only return single classname results View modes: 
User avatar
Member
Member
seanbun-gmail - 5/5/2009 11:32:25 PM
   
TreeProvider.SelectNodes method only return single classname results
Hi,

I have found a problem on the "SelectNodes" method under TreeProvider class. When I executed below line of code, I expected to return all nodes with doctype "x" and "y" under the aliaispath "/Content/%/%". However, it now only returns the first doctype in the classname field which is "x" in my case.

DataSet ds = treeprovider.SelectNodes(sitename, "/Content/%/%", "en-us", false, "x;y", "", "NodeID", 1);

Please advise.

Matt

User avatar
Member
Member
seanbun-gmail - 5/6/2009 7:18:05 PM
   
RE:TreeProvider.SelectNodes method only return single classname results
Resolved.

Different classname results return to seperate table in the result DataSet.

It is worth to mention in the docuementation.

Cheers,
matt

User avatar
Member
Member
sprintstar - 2/23/2012 4:24:21 AM
   
RE:TreeProvider.SelectNodes method only return single classname results
Just fell fowl of this myself.. :|

User avatar
Member
Member
kentico_michal - 2/23/2012 5:17:53 AM
   
RE:TreeProvider.SelectNodes method only return single classname results
Hello,

By default, the returned data set contains more tables. Each table contains nodes of different document type. So, you need to loop through all tables in order to get nodes of other document types.

If you want do not want to create a different table for each document type, you need to set the MergeResults property of the TreeProvider to true before executing the SelectNodes method:

treeprovider.MergeResults = true;

as it is mentioned in the following article: SelectNodes with various document types. It should ensure that the first table of the returned dataset will contain all data.

Best regards,
Michal Legen