Hello! in C# - how can i use a variable in this SelectSingleNode statement?
assuming fieldId is a var or string.
XmlElement elt = xml.SelectSingleNode(String.Format("responses/response/fieldset/field[@id={0}']", fieldId)) as XmlElement;
thanks!
Hello! in C# - how can i use a variable in this SelectSingleNode statement?
assuming fieldId is a var or string.
XmlElement elt = xml.SelectSingleNode(String.Format("responses/response/fieldset/field[@id={0}']", fieldId)) as XmlElement;
thanks!
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
r21 reputationPosted Dec 9, 2022, 12:05 PM EST
XmlElement elt = xml.SelectSingleNode(String.Format("responses/response/fieldset/field[@id={0}]", fieldId)) as XmlElement;
Clarification - after execution elt is NULL