Technical support This forum is closed.
Version 1.x > Technical support > Where parameter of tree.SelectNodes confusing... View modes: 
User avatar
Member
Member
argodev - 3/6/2006 5:31:45 PM
   
Where parameter of tree.SelectNodes confusing...
I'm working on a page wherein I'm using a nested repeater and therefore am using the tree.SelectNodes method in a fashion similar to that referenced by the developer's chm file nested repeater sample.

The problem I've run into, is that I'd like to filter the "master" table by one of the colums so naturally i assumed that I could use the "where" parameter of the SelectNodes() method however I'm unable to do so. It appears that the methods wants to apply the "where" clause to both tables that I'm returning into my data set, which obviously causes an error (the filter is invalid on the "child" table).

I've worked-around the problem by getting the full set and then creating a DataView that is "filtered" and then utilize that as the data source for my "parent" repeater.

My question is, is this simply how the where parameter of SelectNodes works? or is there some syntax I can use to simplify the process?

User avatar
Guest
admin - 3/7/2006 5:39:48 PM
   
Re: Where parameter of tree.SelectNodes confusing...
Hi Rob,

yes, this is a default behavior. The WHERE parameter is applied to both queries which means you can use only the CMS_TREE table columns in case you're requesting several document types (class names).

Alternatively, you could first run the SelectNodes method for the parent documents only and store the results to ds1.
Then, you would run the SelectNodes method for the child documents and store the result to ds2.

Then, you would copy the DataTable from ds2 to ds1 and create the relation.

The rest is the same.

Please let me know if you need any help with that.

Best Regards,