Solved

C# Contstant Database View

Posted on 2009-03-31
2
346 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

749 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