I had another chat with my client today to discuss the last few reports they want, so I'll be finishing up that project this weekend, and they've also asked me to write another program to keep track of membership subscriptions for them (if they'd asked me to do that originally, I would have done it all in one program, but oh well).
I did kind of hack my way through writing my first program as I didn't think I had enough time to learn C# before starting, so I just approached it the way I would a C/C++ program and then googled the C# way of doing the equivalent when I got stuck. Because of this the way I stored the data I read from my Access database was by first creating a class to hold the data from each table and then stored the data in lists.
I've since learned about datasets, and that's what I'll use to represent the database in the second program. The way I wrote the data back to the database was by creating an event handler that fired every time a field on my form lost focus, and if the data in the field was different from that stored in memory, I altered the memory version then created a oledb connection and wrote the data back to the database.
This time I'll use a DataAdapter to write to the database, but I'd like some advice on when to write the data to the database. The client doesn't want the user to need to manually save anything so the process needs to be done automatically.
So I can either do what I'm already doing, and update everytime the user changes the contents of a field, or I was thinking I can also set up a timer to update in the background every few seconds, and then do a last update on exit if they clsoe the application between timed updates.
Which of these two methods would you advise, or is there a third method that I haven't considered?
Nb. Using Access to store the data is a client requirement, so I can't change that.