Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Automatically updating controls when db is updated 1

Status
Not open for further replies.

drewson

MIS
Jun 3, 2003
50
US
Hi,

I've been searching for awhile on this topic and I may be posting in the wrong forum, but would someone just point me in the right direction? I think I may need to use COM+, which I have zero experience with.

Basically, I have a distributed data entry system. I have an "administrator" program that allows the admin to see all records for batches and their status (a basic dashboard system).

My problem is that I'm always updating a listview control to show the latest status of the database. Is there a way to "trigger" the admin program so that when another user updates a record in the database, the program automatically updates the associated line in the listview (or whatever other component it is) instead of refreshing the entire list? To make matters worse, I'm querying an Access database with the Jet provider that gives me random unspecified errors when I refresh the listview by clearing and reloading all the data. I'm planning on moving to MySQL.

From what I've researched, a publisher-subscriber model from COM+ may be what I'm looking for. Will anyone shed some light on this issue for me?

Thanks!
Drew
 
I have a similar process based application. It's a phone directory that users can check in/out on to show the receptionists if they are at their desks. In order to get the receptionists' display to update automaticly here is what we did:

First, we created an update table. This table contained a single row that contains the time of the latest update. Then we added a trigger to the in/out status table. When ever that table changes the update table gets updated. On the client we have a query on a timer that launches every 10 seconds. It checks to see if the value from the update table is greater then the last update. If it is, it pulls the latest data from the primary table. You can do this whole process with just using time stamps on the primary table, which makes the process slightly simpler, but has a bit more load on the database.

-Rick

VB.Net Forum forum796 forum855 ASP.NET Forum
[monkey]I believe in killer coding ninja monkeys.[monkey]
 
That's great, and I'm currently using a timer to refresh the list, but when I have a few hundred records in the list, it drastically slows the UI every time it is updated. Is there a way to update the listview without clearing and refreshing everything?
 
One option, like what I described is to pull the update method off of the primary data. That way, the slow down only occures when an update is published, instead of every time the check occures.

Another would be to create your own solution that would only update those rows that have changed. You could pull out all of the records from the database that have an updated time that is greator then your last update check, then loop through those records and update the data table that your controls are bound to.

-Rick

VB.Net Forum forum796 forum855 ASP.NET Forum
[monkey]I believe in killer coding ninja monkeys.[monkey]
 
I think the only updating changed rows will work best for me!

Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top