SelectNodes from Textbox Syntax

Simple Question,
I have the following code, and instead of searching for "111-11-1111" number, I would like it to search from whatever information has been inputed into textbox1.text
This is really simple but I couldnt get it to work. I tried putting in ("//SSN[. = 'ssnBox.Text']/parent::node()/FirstName" however It did not work.

        Dim SSNList As System.Xml.XmlNodeList
        Dim node As System.Xml.XmlNode

        SSNList = xDoc.SelectNodes("//SSN[. = '111-11-1111']/parent::node()/FirstName")
        For Each node In SSNList
            System.Diagnostics.Debug.WriteLine(node.InnerText)
        Next
LVL 3
JasonWinnAsked:
Who is Participating?
 
Carl TawnSystems and Integration DeveloperCommented:
You need to use:

    SSNList = xDoc.SelectNodes("//SSN[. = '" & ssnBox.Text & "']/parent::node()/FirstName")
0
 
JasonWinnAuthor Commented:
Thanks alot carl_tawn!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.