Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27554

Serializing Arrays Within An Object/Structure

$
0
0
I've been trying to serialize an object along with its arrays, but I only get the direct children of the objects for some reason. This is what comes out in the XML in place of the array contents:

Code:

<chaptertitle>
    <anyType xsi:nil="true" />
  </chaptertitle>
  <chaptercontent>
    <anyType xsi:nil="true" />
  </chaptercontent>

My code is this:

Code:

Imports System.IO
Imports System.Xml.Serialization

'...

Dim objStreamWriter As New StreamWriter(guide & ".chp")
        Dim xmlWrite As New XmlSerializer(GD.GetType)
        xmlWrite.Serialize(objStreamWriter, GD)

Where GD is an object with Strings and the two arrays seen above.

Thanks.

Viewing all articles
Browse latest Browse all 27554

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>