Getting data from an XML serialised class .

B

Bredahl jensen

Hello,
I'm calling a web method of an xml web service. The method returns a class
that is
serialized according to an xml schema definition.
The xml schema is very extensive an has several level of nodes (child
nodes).

My question is: How can i best read data from the class that the web method
returns.

I'm thinking converting the class to a dataset. Does tha make any sens?


Many thanks in advance


JB
 
N

Nicholas Paldino [.NET/C# MVP]

Bredhal,

It depends on what you are going to do with the class. If there are a
lot of relations between the nodes of data, then a data set might be better,
as it will capture those relations better. The reason for this is that with
XML Serialization, it does not take int account relations between nodes (if
one node references another node of data, it won't pick it up).

I think it would be easier to just use the dataset anyways, since you
have so many levels.

Hope this helps.
 
J

Jensen Bredhal

Great,
How do i go from the class to the dataset?
The class is serializable.
How to proceed to get the corresponding DataSet?
 
N

Nicholas Paldino [.NET/C# MVP]

Jensen,

You can just call the ReadXml method on the DataSet to load the XML into
the dataset.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top