How to handle upgrade to user xml file?

ppsa

Member
Joined
Sep 28, 2008
Messages
13
Programming Experience
10+
I have created a vb.net forms application that uses an xml file to store user data (not settings data--data they add, modify and delete using a datagridview in the application). Now, I've made changes to the application, including to the structure of that xml file. I'd like to push out an update to my users. How do I handle the new changes to their individual xml files? Thank you.
 
Hi,

I do quite a bit of this sort of thing using JSON files in certain situations where a Database is not practical. The way I go about it is to Serialise and Deserialise the files into class objects that can then be used in the project. By doing things this way you could, for example, release a project with a file that has 5 Properties and your users begin to use that file. You then release an update to your project with 6 Properties in the file now. The Next Time the OLD file is read only the 5 Original Properties are read into the Class Object but the Next Time the File is written it then writes it with the 6 Properties ready for reading again later.

All this will depend on exactly what it is you are doing but hopefully this should give you some idea about where to start.

Hope that helps.

Cheers,

Ian
 
Back
Top