User1918509225 posted
Hi indyitman,
For your post ,here are my suggestion:
First ,get all the elements whose name is DataElement,just like below:
IEnumerable<XElement> q = from ele in ex.Elements("DataElement")
Select ele;
Seconde iterate the elements founded above,and find if its chid element has a element named “QuestionName”,
if it has,get the value,if not have ,just skip the loop,just like code below:
string val="";
foreach (XElement x in q.Elements()) {
if (x.Name == "QuestionName") {
val = x.Value;
}
}
If you have more than one element “QuestionName”,you can try to add the value into a List<string>,just like below:
List<string> list=new List<string>();
foreach (XElement x in q.Elements()) {
if (x.Name == "QuestionName") {
list.Add(x.Value);
}
}
Hope it can help you.