This has to be a BUG

  • Thread starter Thread starter Michael
  • Start date Start date
M

Michael

After spending a few hours experimenting the typed dataset serialization
(see previous post "How to include public properties in a typed dataset in
serialization"), this is what I found which does look like a bug (I'm using
the normal serialization with XmlSerializer):

.. The values for the public property are in fact written into the Xml.
They are presented as the attributes of the Element for the Dataset. They
have the namespace of "msdata".
.. If the public property is of Int16, it will be ignored and not written
into the Xml.
.. For the public properties which are written into the Xml, the
deserialization does not recover them. This means that the instance
returned from the deserialization doesn't have these property values set.

So it seems to me that something is only half done here. If the behaviour
is by design, then I don't understand why these public properties were
written into the Xml in the first place. And why properties with certain
data type are not written into the Xml at the same time.

Michael
 
Hi Michael,

Please reference to the original thread. Thanks!

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
 
OK, this is what you get if you want to include a custom public property in
your typed dataset for serialization.

.. the normal serialization does not work (XmlSerializer or
BinarySerializer)
.. you must use Dataset.WriteXml and Dataset.ReadXml (with IncludeSchema
option) to serialize and deserialize the typed dataset.
.. this means that you can't binary serialize your typed dataset
.. If the public property is of Int16, it's simply ignored and won't be
serialized

So it's not an ideal "by design" situation, is it? It does seem to suggest
that improvements need to be made here.
 
Back
Top