Riddhi Valecha

Riddhi Valecha

  • 443
  • 3.3k
  • 413k

XML String to Object in C#

Feb 22 2014 4:16 AM
Hi all,
I need help in converting XML String to C# Object and vice-versa.

My requirement is -

The table I am using is as follows -

ID  Date XML DataCompany Location 
 1 1/2/2012<?xml version="1.0"?> A F
 22/2/2012  <?xml version="1.0"?> B E
 3 3/2/2012 <?xml version="1.0"?> C D 

The XML Data is a long string with all the columns - ID, Date, Company and Location.

Now, I want to convert this XML String to C# Object.

Also, I need a function to convert the object to XML String.

i.e. Serialization and Deserialization.

I don't have any specific class to convert XML to Object.

I am getting these records from sql to dataset.

Please help me out.

Thanks a lot in advance...

Answers (1)