Get XML String Out of an Instance of a Class Generated from an XSD File by XSD.exe

/ Published in: C#
Save to your folder(s)

Copy this code and paste it in your HTML
  1. TextWriter writer = new StringWriter();
  2. XmlSerializer serializer = new XmlSerializer(myObject.GetType());
  3. serializer.Serialize(writer, myObject);
  4. return writer.ToString();

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.