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.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
rPosted Dec 9, 2022, 5:05 PM
XmlElement elt = xml.SelectSingleNode(String.Format("responses/response/fieldset/field[@id={0}]", fieldId)) as XmlElement;
Clarification - after execution elt is NULL