Serializing and Deserializing Value Types to String
From: Earl Teigrob (earlt777_at_hotmail.com)
Date: 05/28/04
- Next message: Laszlo Szijarto: "Re: BinaryReader -- can it be forced to read a BigEndian stream"
- Previous message: Laszlo Szijarto: "Re: BinaryReader -- can it be forced to read a BigEndian stream"
- Next in thread: Sherif ElMetainy: "Re: Serializing and Deserializing Value Types to String"
- Reply: Sherif ElMetainy: "Re: Serializing and Deserializing Value Types to String"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 28 May 2004 15:19:35 -0500
I am saving and restoring value types such as Int32, DateTime and Boolean in
strings. I was wondering if there is a mechanism build into .NET for
serializing and deserializing these to string format. I can, of course,
serialize a class to a file, either binary or XML, but this is not what I am
looking for. Currently I am using ToString() or Convert.xxx to do this, but
thought that if there was a true serializer, deserializer, that would be
perfect.
An example would be the way that a DateTime column in a DataTable is
serialized to XML. It is converted to the format
"2004-04-30T19:30:00.0000000-05:00". Microsoft has built a special DateTime
serializer into there XML converter to save (and restore) DateTime in a
string (for XML) format. This saves the time with maximum precision,
relative to MGT.
Can I access to class to do something similar?
Thanks for you Input
Earl
- Next message: Laszlo Szijarto: "Re: BinaryReader -- can it be forced to read a BigEndian stream"
- Previous message: Laszlo Szijarto: "Re: BinaryReader -- can it be forced to read a BigEndian stream"
- Next in thread: Sherif ElMetainy: "Re: Serializing and Deserializing Value Types to String"
- Reply: Sherif ElMetainy: "Re: Serializing and Deserializing Value Types to String"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|