Creating refresh

edd1em

Active member
Joined
Jul 21, 2004
Messages
28
Programming Experience
3-5
Hi, first off I would like to thank everyone in advance for any help provided.
I am trying to create a refresh procedure for my application. This application would be used by several users on separate machines on the network. This application uses no databinding and has a table for each form.

I do not want to put the refresh on a timer. Although for the time being, this is what I am doing.

Here is my idea:
1. Create a table in the db with a date\time field for each table that is in the db.
2. Create an array in the application which has a space for each field in the table created in step 1.
3. Every time data is updated in a table, a trigger is hit, which writes the current date\timein the field corresponding to the table in step 1.
4. On a timer, the application compares the date\time value in the array with the date\timevalue in the table created in step 1.
5. If the value is a different, the application refreshes that particular table.

Now this may work, but it relies on date\time... If the time is not the same accross the board, this will not work...

So, are there any other ideas?
-Edward
 

Schenz

Well-known member
Joined
Sep 11, 2004
Messages
181
Location
Cincinnati, OH
Programming Experience
5-10
My suggestion is to change steps one, two, and four.

1. Create a table in the db with a TimeStamp field for each table that is in the db.
2. Create a DataTable in the application for the table created in step 1.
3. Every time data is updated in a table, a trigger is hit, which writes the current TimeStamp in the field corresponding to the table in step 1.
4. Before requesting Data from a table check to see if current DB values are different from DataTable created in Step 2
5. If the value is a different, the application refreshes that particular table.

If your DB supports a TimeStamp type, it should use the DB server's time removing the chances for the time being different on the clients. Also rather than using a timer in step four, I would check for updates just before requesting info from the DB, or before doing an update, etc...
 
Top Bottom