We have XML files sent to us from several customers. The file structure is the same for all of them.
I wish to write a standalone c# program so users can open and view these files. However, I have never played with XML before and the files are pretty big and nested.
Can someone give me a clue with a tutorial or idea which is the best way to go about this?
I have the mdiparent done and I beleive the file>open>Stream is ready and correct. I don't mind if I have to use Crystal reports or even a datagrid. It may be that I need to use a schema file but I have found it all pretty confusing so far (the nested bit). From what I have tried so far I get the error
"The table (Body) cannot be the child table to itself in nested relations."
Can anyone give me a clue?
-
using (myStream){
//do stuff here
}
Cheers
Chris
Chris

ali tuncerRank #1,499 · 1.1K reputationPosted Mar 31, 2016, 11:49 PM EDT
I received the same error when I tried to put in dataset..
But a small change in xml file fixed it, I am attaching the file..
........
ali tuncerRank #1,499 · 1.1K reputationPosted Mar 31, 2016, 1:27 AM EDT
You could generate classes from XML file:
http://stackoverflow.com/questions/4203540/generate-c-sharp-class-from-xml
Nishant MittalRank #692 · 3.5K reputationPosted Mar 30, 2016, 9:50 PM EDT
Chris Johnson71 reputationPosted Mar 30, 2016, 11:54 PM EDT
Chris Johnson71 reputationPosted Mar 31, 2016, 2:14 AM EDT
Error: There was an error processing 'chris.xml'.
- The table (Body) cannot be the child table to itself in nested relations.
ali tuncerRank #1,499 · 1.1K reputationPosted Mar 31, 2016, 8:47 PM EDT
When do you get it? Is it when you generate class?
Are you sure xml file is valid/properly formatted? which .net version are you using?
Chris Johnson71 reputationPosted Mar 31, 2016, 11:31 PM EDT
Hi Ali, I get the error when trying to format the incoming xml using standard code I found on the web. If it's simple flat xml I can format that fine.
I think the best thing for me to do is give an example of the file. (Attached)
As you can see, the nesting is pretty complex, the formatting I have tested online and the website says it's good.
Chris Johnson71 reputationPosted Apr 1, 2016, 12:08 AM EDT