How to Deserialize Object from XML in C#

14 Apr 2014, 07:19 AM

In .net framework XmlSerializer class is used to serialize and de serialize object. Create the instance of the XmlSerializer() class and pass the type of the object as parameter. Call the Deserialize method to get the XML

 
var reader = new StringReader(xmlString);
var serializer = new System.Xml.Serialization.XmlSerializer(typeof(Student));

var instance = (Student)serializer.Deserialize(reader);

Related Contents

15 May 2014, 08:07 AM
C#, LINQ, List
15 May 2014, 07:54 AM
C#, LINQ, List
29 Apr 2014, 03:07 AM
C#, Generic
About
Explains how create object from XML using deserialize in C#

Date Posted 14 Apr 2014, 07:04 AM
Author Brainy Solutions
Views 1,716
;