Walaa wrote:
When you get to add the ppeClientPlans to a PrefetchPath2 object you should supply a sort expression.
There is an overload of the prefetchPath2.Add() method that accepts a SortExpression.
Yes, but my problem is I have to add the IPrefetchPathElement2 to the subpath of another, then I add the root IPefetchPathElement2 to the PrefetchPath2 object. Now if I include a sort expression I will get an error becuse the table.field I am sorting is several paths deep from the established root of the PrefectPath2 object.
For example (heirachy is clients -> clientPlans -> servers):
ppeClientPlans.SubPath.Add(ppeServers);
ppeClients.SubPath.Add(ppeClientPlans);
prefetchPath.Add(ppeClients); //here I cannot add a SortExpression for ClientPlansFields.fieldName
Thank you!