xml to Object

A

AA

I have this xml..

<xmlData>
<Names>
<Name>John</Name>
<Name>Peter</Name>
<Name>Maria</Name>
</Names>
</xmlData>


and this object...

Public Class xmlData
Public Names() as String
End Class

But I Can't make the serialization

Why??
I Can modify my object, but the Xml document don't
 
A

AA

Sorry, .. my problem is not the serialization himself, the problem is that
the serialization process don't recognizes the <Name> element as a part of
the <Names> Collection

The Members collection is empty after the serialization. But, If I change
the element name <Name> by <string> The collection is filled


Thanks

michaelw said:
First off if you are planning on serializing an object it is best to
implement ISerializable or use the Serializable attribute.
Another option is using the classes in the System.Xml.Serialization
namespace.
 

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