NewDev
NewDev

Reputation: 21

Easily read and write XML using C#

I have already found something for reading XML, however I find it difficult to write and update XML.

Can anybody please help in giving some code or advice on the best way of writing to XML files?

Upvotes: 2

Views: 488

Answers (2)

Finglas
Finglas

Reputation: 15709

Use LINQ to XML.

Based on the fact you're using .NET 3.5, LINQ to XML makes life so much easier when working with XML. Reading, writing, and amending XML documents via LINQ is a breeze. The link I posted is just a quick overview, but it should at least give you a taste of what it's like.

Upvotes: 8

Gerrie Schenck
Gerrie Schenck

Reputation: 22368

Load it up in an XmlDocument first. Also see the link for more information and examples.

Upvotes: 1

Related Questions