sign in | join about | help | sitemap
Connecting Tech Pros Worldwide
Tom Kiernan's Avatar

Element Order in Serialized Class


Question posted by: Tom Kiernan (Guest) on November 12th, 2005 05:08 AM
I have a class written in C# that generally serializes fine. The issue that
I have is that I need to be able to submit the serialized data to another
system and that system seems to be very sensitive to the order of the
elements.

Is there any way to force the classes within the main (root) class to be in
a certain order. When I serialize it, the order actually seems sort of
random as it doesn't seem to matter which class is defined first in the
source file or instantiated first, etc.

As background, I create the class and member classes and fill in the
appropriate data. I then create an XMLSerializer object and use the
Serialize method.

Any ideas would be appreciated.



1 Answer Posted
DC's Avatar
Guest - n/a Posts
#2: Re: Element Order in Serialized Class

http://tinyurl.com/8a8c8


"Tom Kiernan" <TomKiernan@discussions.microsoft.com> wrote in message
news:C00768C5-01D8-40B2-AA51-7791EA99FB14@microsoft.com...[color=blue]
>I have a class written in C# that generally serializes fine. The issue
>that
> I have is that I need to be able to submit the serialized data to another
> system and that system seems to be very sensitive to the order of the
> elements.
>
> Is there any way to force the classes within the main (root) class to be
> in
> a certain order. When I serialize it, the order actually seems sort of
> random as it doesn't seem to matter which class is defined first in the
> source file or instantiated first, etc.
>
> As background, I create the class and member classes and fill in the
> appropriate data. I then create an XMLSerializer object and use the
> Serialize method.
>
> Any ideas would be appreciated.
>
>
>[/color]


 
Not the answer you were looking for? Post your question . . .
196,824 members ready to help you find a solution.
Join Bytes.com

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 196,824 network members.
Post your question now . . .
It's fast and it's free

Popular Articles

Top Community Contributors