Problem with XPath expression

M

McCool

I am getting the following error "Expression must evaluate to a node-set" for
the following section of code:

XPathExpression myExpression =
root.Compile("//my:WorkPackage/my:BandRCodes/my:BandR = '" + BandRCode +
"'/my:programCodes");

myExpression.SetContext(NamespaceManager);

XPathNodeIterator myPCs = root.Select(myExpression);

This is my first time trying to set up a query/filter in code. Does
everything look ok with this?

Thanks,
Brian
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top