Solved

C# Contstant Database View

Posted on 2009-03-31
2
339 Views
Last Modified: 2013-11-08
Hello Experts,
I am writing an application in C# for a type of dispatch. Multiple people will use the software to connect to the database and view current dispatch ques. I was planning on simply using the DataGrid View, my question is how I keep that updated, what is the best way to check for changes someone else might have made. I was thinking about using a timer every 500 ms but I am worried abou the number of connections to the database.

Thanks
0
Comment
Question by:sethwhitworth
2 Comments
 
LVL 32

Accepted Solution

by:
Daniel Wilson earned 250 total points
Comment Utility
If your SELECT statement is well optimized, that should not be a problem.

screen flicker might be ... or some other paint-time issues.

An automatic refresh would be very annoying if the user is supposed to interact with the grid -- scroll it, check something off on it, or something like that.  But for a view-only scenario that all fits on a single screen, that should work fine.
0
 
LVL 26

Assisted Solution

by:Anurag Thakur
Anurag Thakur earned 250 total points
Comment Utility
i agree with the previous comment that the data refresh will make the grid flicker a little and might annoy the user a little but if you still want to implement then dont update it every 5 seconds as you are thinking of doing

1 update it every 30 seconds
2 and in the updating logic build in one more logic i.e. (assuming you are keeing the last modified datetime of the dispatch record) send the latest dispach update that is already present on the client side to the database and if that time is older than whats there in the database then only update it else leave it like that (will save some processing)
3 when you do an update the  data for dispatch just check the modified date time in the db - if they both match then only update else send an error message back that someone else has updated so the grid needs to be refreshed
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video discusses moving either the default database or any database to a new volume.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now