I'm developing wp7 app . i have a problem with this cod i want to get values of table from a webservice and show it in msg box the problem is i have two tables in a web service but in foreach only the first value can shown in two times any one can help by knowing the prob???

foreach (XElement nod in resultElements.Elements(@"studentPunishmentsTable"))
    {
         s.penalty = resultElements.Element("studentPunishmentsTable").Element("penalty").Value;
         MessageBox.Show(s.penalty);     
    }

the solution is:

Inline Code Example Here

> foreach (XElement nod in resultElements.Elements(@"studentPunishmentsTable"))

{

s.panalty=nod.element("penalty").value;
messageBox.show(s.penalty);
}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.