Click here to Skip to main content
15,915,651 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am trying to read xml file using C# .net. But i dont want to use DataSet and want to read data and show in a table format.
The xml file i am using is having multiple child nodes. Please help me how to read it manually, (without dataset).
Posted

There are hundreds of thousands of examples regarding reading XML files in C#. Surely, you could have found this one:

http://support.microsoft.com/kb/307548[^]
 
Share this answer
 
Comments
omkar jante 18-Mar-11 8:27am    
i gone through this link earlier but the xml i am using is not fixed format. some times some nodes may missing and hirarchy is also got changed. suggest me
#realJSOP 18-Mar-11 8:58am    
Some nodes may be missing? Hierarchy changes? How can you possibly read that in any kind of automatic way?
Sergey Alexandrovich Kryukov 19-Mar-11 1:29am    
I think OP does not know the schema. It should not change but just a bit more complex. "Missing nodes" is nothing wrong, could be perfectly described with the schema. Your answer is correct, a 5. Could be more complete, but... let OP do the homework.
--SA
Albin Abel 18-Mar-11 8:41am    
omkar, if your xml doesn't follow a schema then how a code knows how to read it? though it can be populated automatically to a dataset etc etc, how your business logic going to use it?
Albin Abel 18-Mar-11 8:42am    
my 5 for the advice
Use the XmlDocument.Load method:

http://msdn.microsoft.com/en-us/library/875kz807.aspx[^]
 
Share this answer
 
Comments
Albin Abel 18-Mar-11 8:43am    
Another microsoft link. My 5.

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