Question

I have a C# application which is used to modify PowerPoint files. The files are in our network and a lot of people need to work with them. But at every given time, only one person works with a presentation. I used to store some metadata, for each presentation, in a central serialized xml file located in our network. The struture of the metadata is a simple List where each item is a filename and other properties. The filename is used to identify each entry.

Now my program is used often used by different people, who are working on different presentations and when they go home, my program saves the metadata to the file. Unfortunately, the last user to go home wins and overwrites all changes by other users.

So how can I avoid that? Clearly, I need a better data storage technique, which saves only the changes made by the user. But I cannot use any other technique than files stored on our network (but I am not limited to xml files...)

Was it helpful?

Solution

Why not use a SQLite database? It stores all it's data in a single file (which you can store on your network), and gives you the flexibility of a relational database where you can use techniques like pessimistic and/or optimistic concurrency checks. You'll also be able to more easily store each user's data.

EDIT: An SO question which deals with how to use SQLite from c# applications

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top