Answered by:
Whats the best way to store a Collection(s) as XML?

Question
-
Is there a way to like convert a Collection to XML format in perhaps a line or two? And then get it back the same way?
Or do you have to loop through it an use System.Xml.XmlWriter / System.Xml.XmlReader?Thanks! :)
Tuesday, July 10, 2012 3:13 AM
Answers
-
Is there a way to like convert a Collection to XML
This process is called serialization
http://www.codeproject.com/Articles/1789/Object-Serialization-using-C
http://support.microsoft.com/kb/815813
Tuesday, July 10, 2012 3:48 AM
All replies
-
Is there a way to like convert a Collection to XML
This process is called serialization
http://www.codeproject.com/Articles/1789/Object-Serialization-using-C
http://support.microsoft.com/kb/815813
Tuesday, July 10, 2012 3:48 AM -
If you really really need to have exact control over the output you could go with Linq to XML too. Although this method is less limited than the XmlSerializer it needs much more coding and is more error-prone.
Tuesday, July 10, 2012 5:48 AM -
If you use the binary serializer, is the data extractable by another program or decyperable by a person? Do they need the exact layout of your class? Or can they look at it and figure it out?
Sunday, July 15, 2012 4:09 PM -
For XML ,syed amjad's have provided useful information for you , so I will mark his post as answer.
More, for binary serializer, it can be decyperable in another program.
http://msdn.microsoft.com/en-us/library/72hyey7b(v=vs.110).aspx
Sunday, July 15, 2012 10:14 PM