| | |
compare 2 xml files with csharp
Please support our C# advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Mar 2006
Posts: 31
Reputation:
Solved Threads: 0
•
•
•
•
Originally Posted by plazmo
sure just look at the rows itemarray and check what has changed
like do this after you find a matching id:
for(int i=0;i<pcRow.ItemArray.Length;i++){
if(pcRow.ItemArray[i] != serverRow.ItemArray[i])
{then this item is different in this column of the row}
}
If i found the item which is different from the pcXML doc, how can i make it copy or clone to from serverXML to pcXML?
I tried this:
serverRow.ItemArray.Clone(outputXML);
its correct code, no errors, but it doesnt work. I have no idea how its possible to clone from file to file.
Also i keep seeing this in the console when i execute this program:
'Collection was modified; enumeration operation might not execute'
What does that mean?
Thanks in advance!
look at what i did to copy a different row!
you make a row object with the same shceme as the table then copy to source itemarray to the new row, then append the row to the talbe
C# Syntax (Toggle Plain Text)
DataRow newRow = outputXML.Tables[0].NewRow(); //make a new row with the tables scheme newRow.ItemArray = pcRow.ItemArray; //copy over the contents of the row outputXML.Tables[0].Rows.Add(newRow);
you make a row object with the same shceme as the table then copy to source itemarray to the new row, then append the row to the talbe
•
•
Join Date: Mar 2006
Posts: 31
Reputation:
Solved Threads: 0
•
•
•
•
Originally Posted by plazmo
look at what i did to copy a different row!
C# Syntax (Toggle Plain Text)
DataRow newRow = outputXML.Tables[0].NewRow(); //make a new row with the tables scheme newRow.ItemArray = pcRow.ItemArray; //copy over the contents of the row outputXML.Tables[0].Rows.Add(newRow);
you make a row object with the same shceme as the table then copy to source itemarray to the new row, then append the row to the talbe
Oh ofcourse, stupid me. Im sorry, its just that i worked on this for like a week fulltime.
I can't think straight anymore :eek:
Thanks plazmo
![]() |
Similar Threads
- Java code to compare XML files (Java)
- How to compare folders of XML files in Perl using ExamXML (Perl)
Other Threads in the C# Forum
- Previous Thread: FolderBrowserDialog problems
- Next Thread: Exporting Data from App To Excel c#
| Thread Tools | Search this Thread |
Tag cloud for C#
.net access ado.net algorithm array barchart bitmap box broadcast buttons c# chat check checkbox class client color combobox control conversion csharp custom database datagridview dataset datetime degrees development draganddrop drawing encryption enum excel file files form format forms ftp function gdi+ httpwebrequest image index input install java label list listbox listener login mandelbrot math mouseclick mysql networking object operator oracle path photoshop picturebox post prime programming radians regex remote remoting resource richtextbox save saving serialization server sleep socket sql statistics stream string table tcp text textbox thread time timer treeview update usercontrol validation view visualstudio webbrowser windows winforms wpf xml





