Click here to Skip to main content
15,891,706 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Problem while fetching data from two XML

Even is it possible or not I don't know.

suppose there are two XML files like
Order.XML
Party.XML


I can fetch data from single xml file like
C#
var query = from order in xmlOrder.Elements(Orders).Elements(Order)
select order;


where Order.XML contains Party Id

Now I want to join this two files
In short want to fire Joint query

Thanks in advance
:)
Posted

HERE'S[^] a quite neat example on Joining in XML with LINQ.
 
Share this answer
 
Comments
Rajesh Anuhya 5-Jan-11 3:04am    
Good Call +5
If you are using List you can use .AddRange to add one list to the other list.
Or you can use yield return to combine lists on the fly like this:
public IEnumerable<string> Combine(IEnumerable<string> col1, IEnumerable<string> col2)
{
    foreach(string item in col1)
        yield return item;
    foreach(string item in col2)
        yield return item;
}

Hope this will help you.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900