Count records using LINQ2XML

JoshuaVN54

New Member
I need to get the count of the \[code\]inbound\[/code\] transactions and the \[code\]outbound\[/code\] transactions separately. I have tried everything I know, but nothing is working. Here's the XML:\[code\]<?xml version="1.0" encoding="utf-8"?><records> <inbound> <transaction> <customerID>0002</customerID> <customerName>bob</customerName> </transaction> <transaction> <customerID>0003</customerID> <customerName>harry</customerName> </transaction> . . . <transaction> <customerID>0250</customerID> <customerName>joe</customerName> </transaction> </inbound> <outbound> <transaction> <customerID>0002</customerID> <customerName>bob</customerName> </transaction> <transaction> <customerID>0003</customerID> <customerName>harry</customerName> </transaction> . . . <transaction> <customerID>0175</customerID> <customerName>frank</customerName> </transaction> </outbound></records>\[/code\]This needs to be in C# and LINQ. Thanks for any help.
 
Back
Top