Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

deserializing xml

Status
Not open for further replies.

JohnBeton

Programmer
Feb 9, 2004
21
BE
Hi,

I have a problem deserializing xml into objects.
my class structure:
orderHeader
order
orderDetail

orderHeader has an arraylist of [order]
order has an arraylist of [orderDetail]

orderHeader and the arraylist of [order] is filled, but the arraylist of [orderDetail] remains empty.

this is the code i use to deserialize:
Code:
Dim serializer As New XmlSerializer(GetType(orderHeader))
Dim fs As New FileStream("c:\schipUbnOrder.xml", FileMode.Open)
Dim myOrderHeader As orderHeader
myOrderHeader = CType(serializer.Deserialize(fs), orderHeader)
What am i doing wrong ?
Thanks already

John
 
Have you looked at implementing the ISerializable interface?

It's marked as a .NET internal interface, but so many people use it that it will be made public in .net v2.0

It should save you a lot of work.

Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top