Serializing / Deserializing string array problems

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I know this will sound like a lot of hand waving, and I'll be glad to supply
some sample code if necessary, but I thought something obvious might jump out
at someone without doing so. Anyway, I have a structure that has several
members including an array of strings. I assign the elements of the string
array from the .Text property of several TextBoxes. I then serialize the
structure and write it to a file. However, when I deserialize it back from
the file, all members of the original structure are valid except the strings,
which are all empty. I've set a breakpoint just prior to writing the
serializing the structure and the strings are there. However, when I set a
breakpoint just after serialization, they're not. Suggestions are
appreciated.

Thanks,
Ray
 
Ray,

Could you provide some code showing what you are doing? From what you
say, it should work, but obviously, it isn't, so it's impossible to tell
without seeing the relevant code.
 
Hi,

I know this will sound like a lot of hand waving, and I'll be glad to supply
some sample code if necessary, but I thought something obvious might jump out
at someone without doing so. Anyway, I have a structure that has several
members including an array of strings. I assign the elements of the string
array from the .Text property of several TextBoxes. I then serialize the
structure and write it to a file. However, when I deserialize it back from
the file, all members of the original structure are valid except the strings,
which are all empty. I've set a breakpoint just prior to writing the
serializing the structure and the strings are there. However, when I set a
breakpoint just after serialization, they're not. Suggestions are
appreciated.

Thanks,
Ray

Just wondering, have you marked the thing with a 'serializable()'
attribute?

Cheers,
Stefan.
 
Back
Top