?
Solved

C# Contstant Database View

Posted on 2009-03-31
2
Medium Priority
?
355 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 1000 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 1000 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

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…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses

770 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