So, I dunno why this is being so damn difficult, but I can't figure it out.
I'm working with c# and trying to get values out of an xml file.
Code:
IEnumerable<XElement> myPlayers =
from myP in pElements.Elements("Player")
where (string)myP.Element("Name") == pNameCombo.SelectedItem.ToString()
select myP;
I use that to select the correct Player element from the file, but then I can't figure out how to get the other data from myPlayers.
Each player has multiple elements with data and I don't know how to get at it. As an example I have <PlayerName>myName</PlayerName> for each player.
How can I get at that from myPlayers? Am I doing this all wrong?
To be more exact:
Code:
<Player>
<Name>PoopNUG</Name>
<PlayerTag>DANKMEMES</PlayerTag>
<StartStats>
<StartNum>2</StartNum>
<LastUpdated>2015-07-24T22:21:30.5463885-05:00</LastUpdated>
</StartStats>
<CurrentStats>
<CurrentNum>3</CurrentNum>
<LastUpdated>2015-07-24T22:21:30.5463885-05:00</LastUpdated>
</CurrentStats>
</Player>
With many players. I need to find a player by name, then get each element of that player, by name, and it's value. I've tried so many damn things, it's fucking irritating why this is so damn difficult.