title: How do I resolve the error "Expression must evaluate to a node-set" when checking for the existence of a node?
body: <p>I'm attempting to check for the existence of a node using the following .NET code:</p>
  
  <pre><code>xmlDocument.SelectSingleNode(
          String.Format("//ErrorTable/ProjectName/text()='{0}'", projectName));
  </code></pre>
  
  <p>This always raises:</p>
  
  <blockquote>
    <p>XPathException: Expression must evaluate to a node-set. </p>
  </blockquote>
  
  <p>Why am I getting this error and how can I resolve it? Thank you.</p>