XML classes without DataSets

by Dominic Zukiewicz 11. April 2007 16:17
Its sometimes easier to read XML straight into the properties of a class instead of reading into a dataset and then extracting the information needed.

I have written an article on it, see what you think. Its especially helpful when you have complex XML documents!

http://blogs.bdnet.co.uk/dominicz/archive/2007/04/19/Reading-XML-directly-into-classes-instead-of-DataSets.aspx

Tags:

Xml

Comments

4/13/2007 7:48:28 AM #

Serialization is the way forward and is something I've used since 1.0 to do this.  Obviously, you would want to put the Serialize and Deserialize methods in to a helper class for reuse.

It is worth noting that as Dom has mentioned, unless you specify Element/Attribute names in the class definition they will by default serialize using their public name.  Another thing to note (if you're being lazy about it) is that so long as the root object is defined as Serializable, all child objects (unless explicitly denied) will inherit this attribute and will serialize.

Matt Nield |

Powered by BlogEngine.NET 1.5.0.7
Theme by Interakting

Interakting

A full service digital agency offering online strategy, design and usability, systems integration and online marketing services that deliver real business benefits and ensure your online objectives are met.

Calendar

<<  July 2010  >>
MoTuWeThFrSaSu
2829301234
567891011
12131415161718
19202122232425
2627282930311
2345678

View posts in large calendar