LINQ XML extract us ing VB.NET


I would like to extract the element named "Message" from the XML shown below.

Thank you
 <content id="Content0">
  <Message>Order successfully updated.</Message> 

Open in new window

Tom SageAsked:
Who is Participating?
Sreedhar VengalaConnect With a Mentor Sr. Consultant - Business IntelligenceCommented:
XElement doc = XElement.Load("C:\\abc.xml");
IEnumerable<XElement> elements = from r in doc.Descendants("Message") select r;
Sreedhar VengalaSr. Consultant - Business IntelligenceCommented:
Try this:

from r in doc.Descendants("Message") select r;
Tom SageAuthor Commented:
That worked perfectly.  Thank you for your quick reponse.
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.