r

r

  • NA
  • 1k
  • 0

in C# - how can i use a variable in this SelectSingleNode statement?

Dec 9 2022 4:51 PM

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!


Answers (1)