I have an application that gathers data from a SQL database that is used by a 3rd party helpdesk application.

My application is pulling out information of the number of hours worked by each engineer for the current and previous 2 months.

Also as part of this process, my application works out the target hours for each of those months.

My application has 3 groupboxes whose label is generated at runtime.

My application gives the Groupbox1.text the name of the current month, Groupbox2.text the name of the previous month, and Groupbox3.text the name of the month before that (e.g. Mar, Feb, Jan).

What I am trying to do is have 2 text boxes for each month where I can enter the number of engineer holidays taken and the number of public holidays if any. I want to store these values in an XML file, and I guess they need to be stored to match the Groupbox text (i.e. Mar, Feb, Jan).

When the application starts, I need to parse that XML file and re-populate the text boxes with those number of days - BUT if the month has moved on, so that the Groupboxes are now called Apr, Mar, Feb then I want the Mar and Feb data to be loaded, and I want the XML file to be updated so that Apr is added and Jan is removed from it.

I want the XML file to keep the current and previous two months figures only.

Can anyone provide me with a code example of how to do this?

Thanks