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 tuncerPosted Apr 1, 2016, 3:49 AM
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..
........
Chris JohnsonPosted Apr 1, 2016, 4:08 AM
Chris JohnsonPosted Apr 1, 2016, 3:31 AM
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.
ali tuncerPosted Apr 1, 2016, 12:47 AM
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 JohnsonPosted Mar 31, 2016, 6:14 AM
Error: There was an error processing 'chris.xml'.
- The table (Body) cannot be the child table to itself in nested relations.
ali tuncerPosted Mar 31, 2016, 5:27 AM
You could generate classes from XML file:
http://stackoverflow.com/questions/4203540/generate-c-sharp-class-from-xml
Chris JohnsonPosted Mar 31, 2016, 3:54 AM
Nishant MittalPosted Mar 31, 2016, 1:50 AM