XML.NET - Inserting single element node into primary XML file

G

Guest

I have thousand of records that i store in xml file.
During application start up, I load the xml file into a Dataset.

I perform update/deletion/ addition to the dataset.

Periodically I need to write into the xml file. But every time I use
Dataset.WriteXml(filename) method to update the primary xml file
which writes whole dataset record instead of changed record.

This degrades the performance.

Can anyone suggest me as how we can insert only changed record into the
xml file. I tried using diffgram mode. But I could not succeed.

Help is greatly appreciated!!!!
Thanks
Hitesh
 
C

Cor Ligthert

Hitesh,

Do you mean on disk. That you cann't. On disk it is just a flat non
organised file.

I hope this helps

Cor
 
C

Chad Z. Hower aka Kudzu

=?Utf-8?B?SGl0ZXNo?= said:
Can anyone suggest me as how we can insert only changed record into the
xml file. I tried using diffgram mode. But I could not succeed.

As Cor said, you cant. Its not a random access file. You will need to choose
a different file format other than XML.
 
A

Adrian Moore

Hitech,

Have you tried doing the WriteXml(filename) call using a background, worker
thread?

..NET 2.0 has some new features that should help. DataTable now has a
WriteXml method, so tables can be stored in seperate XML files if necessary.
It also can write to a Stream object. .NET 2.0 has a ZIP stream, so you can
write to a zipped XML file.

Hope this helps
Ad.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top