1

I have the following XML Document:

  <?xml version="1.0" encoding="utf-8" ?> 
  <appSettings>
  <Path> blahblahblah </Path> 
  <PathValue> blahblahblah </PathValue> 
  <domainName> blahblahblah </domainName> 
  <SuperUserEmail> blahblahblah </SuperUserEmail> 
  <SuperUserName> blahblahblah </SuperUserName> 
  <UserName> blahblahblah </UserName> 
  <Password> blahblahblah </Password>       
  <connectionstring>Data Source=ABC\SQLEXPRESS;Initial Catalog=mail;User ID=sa;Password=sa@</connectionstring> 
  </appSettings>

Now I have to extract the entire path from connectionstring node. I tried using the following code:

XmlNodeList xnList = xml.SelectNodes("/appSettings/connectionstring");

but it doesn't seem to work. Any idea how to make it work?

Esha
  • 391
  • 1
  • 9
  • 37

1 Answers1

3

TRY

XmlNode node = xml.DocumentElement.SelectSingleNode("/appSettings/connectionstring");

string nodeval=node.InnerText;
Chief
  • 914
  • 1
  • 9
  • 26