I want to get the value of a node <abc>
from xmldata column.
XML data looks like:
<data id="d4E8121C9636942F18AC77F3EECD13ABA">
<d id="pDF21A1781B684FAD8D476BF14F78D52D">
<abc>ABC</abc>
</d>
</data>
Here is the code:
using (var exampleSource = new ExampleDataSource())
{
var xmlData = exampleSource.queue
.Where(a => a.QueueID == queueID)
.Select(a => a.XMLData)
.FirstOrDefault();
var messages = from m in xmlData
select XElement.Parse("abc");
}
As you've said XMLData
is a string
, you need to parse this and then get the value of abc
like so:
var abc = (string)XElement.Parse(xmlData).Descendants("abc").Single();
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments