Solved

SelectNodes from Textbox Syntax

Posted on 2006-06-28
2
194 Views
Last Modified: 2010-04-23
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
0
Comment
Question by:JasonWinn
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 52

Accepted Solution

by:
Carl Tawn earned 500 total points
ID: 17004930
You need to use:

    SSNList = xDoc.SelectNodes("//SSN[. = '" & ssnBox.Text & "']/parent::node()/FirstName")
0
 
LVL 3

Author Comment

by:JasonWinn
ID: 17004937
Thanks alot carl_tawn!
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question