How to Change the XML used as a database for distributed programs

Asked 2 years ago, Updated 2 years ago, 75 views

I created a Windows Form Application in C# and previously released the executable to the customer.The program uses XML as its database.

This time, we added functions to the program.Only exe is changed.We plan to release and install exe only, but we need to make changes to the XML of the customer that is already running.

In this case, what kind of means should I usually use?I imagine releasing a version upgrade patch and running it would fix the inconsistencies in XML.

adding:
With this change, users have the ability to add a template, but the initial items registered from the beginning on that template have been added.Therefore, this new initial item has been added when registering a new template, but no new initial item has been added for the template already registered before this modification.The information for the items registered in each template is stored in XML.Therefore, I would like to add a new item to the existing template item.

If the exe program has a template where the initial item does not exist each time, such as at startup, add the initial item or do nothing.Do we have no choice but to do something like that?

c# xml

2022-09-30 15:36

1 Answers

In my case, the implementation was to embed the version number item into the XML to determine if the data needs to be modified based on the value.
If the version number does not already exist, it is considered the initial version.
Basically, it is processed every time the application starts.

If you just added a new item, there is another way.
If there is an item when you read the data, try to return it, otherwise return the default value.
This method does not require XML modification.


2022-09-30 15:36

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.