Solved

C# Contstant Database View

Posted on 2009-03-31
2
344 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
ID: 24035471
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
ID: 24039050
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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

828 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