Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!
' Load the file1.xml and file2.xml into memory Dim f1 = XDocument.Load("C:\Working Directory\file1.xml") Dim f2 = XDocument.Load("C:\Working Directory\file2.xml") ' Query both documents and Join on the SN node in each Dim results = From n1 In f1.Descendants("Table1") _ Where n1.Element("SN") IsNot Nothing _ From n2 In f2.Descendants("Table1") _ Where n2.Element("SN") IsNot Nothing AndAlso n1.Element("SN").Value = n2.Element("SN").Value _ Select n1, n2 ' Add the NSD node in file2.xml to the corresponding node in file1.xml For Each pair in results pair.n1.Add(pair.n2.Element("NSD")) Next ' Save file1.xml as file3.xml f1.Save("C:\Working Directory\file3.xml")
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.