Hi I've been working on this asp.net webform written on c# and i'm currently stock getting value on XML result encapsulated in a string. I know little about XML and here is my attemps.
i have this XML string
<Code>0</Code>
<responseData>
<LotDetails>
<DEVICE>OH503/E-ICAM</DEVICE>
<DEVICE12NC>340000064194</DEVICE12NC>
<CONTAINERNAME>MBP001012700</CONTAINERNAME>
<PACKAGE>SOT1207</PACKAGE>
</LotDetails>
</responseData>
and i need to get the value of <CONTAINERNAME>
in c# i have this code
string result = tmpVal.GetQueryResult(System.Configuration.ConfigurationManager.AppSettings["queryname_CMSS"].ToString(), System.Configuration.ConfigurationManager.AppSettings["paramnames_CMSS"].ToString(), LotID).InnerXml.ToString();
XmlDocument doc = new XmlDocument();
doc.LoadXml(result);
XmlNode idNode = doc.SelectSingleNode("//responseData/LotDetails/CONTAINERNAME");
My code above returns me an error of dditional information: There are multiple root elements. Line 1, position 16.
It looks like i'm not getting the root element on my XML result.
Would someone help me out with this?
Thank you in advance.
Hope you understand what i mean.
and.
– test_ Jan 27 '20 at 00:06