How can I store an xml node value into a string variable

  • Thread starter Thread starter polachan
  • Start date Start date
P

polachan

Guest
I am trying to store he following value of xml into a string variable. It is not working. But if I am using List<string> it would be working. But I don't need to use list string variable for mailsubject. The mailsubject is only one tag. there is no mutiple tag. So I would like to use string variable to store mailsubject rather than List<string> Please help


string _mailsubject =
element
.SelectNodes("MailSubject")
.Cast<XmlNode>()
.Select(c => c.InnerText.Trim())
.ToString(); // it is not working the value is not coming from xml

<Address>test1@gmail.com</Address>
<Address>test2@gmail.com</Address>
<Address></Address>
<MailSubject>Statement</MailSubject>
<MailBody>Please find statement</MailBody>
<FILENAME>Statement2</FILENAME>





polachan

Continue reading...
 
Back
Top