Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# WinForm BackgroundWorker , +
Hello im making a mdi winforms application c# and i need something that every x minutes, my program makes a search in my database and if found a new record i need that a label text updates in the mdiparent.
 
I know how to do this with a timer in the mdi parent, but i want to make it better and i dont want the timer in my main form , and i know i can use a background worker for this but i havent feigure it out how to do it, can any one help me.
 
sorry if im posting this wrong or in a wrong place is my first question ever.
Posted 12-Mar-13 22:47pm
Comments
skydger at 13-Mar-13 4:18am
   
Hi. What is the database engine do you use?
I also suggest you to type topic of your question in English.

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

It's not trivial, but probably the best way would be to use the SqlDependancy class[^] - that is what it is designed for. When the database changes, it notifies you, rather than you querying the DB all the time.
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 277
1 Maciej Los 220
2 DamithSL 190
3 Raul Iloc 185
4 Richard MacCutchan 175
0 OriginalGriff 5,130
1 DamithSL 4,197
2 Maciej Los 3,670
3 Kornfeld Eliyahu Peter 3,470
4 Sergey Alexandrovich Kryukov 2,821


Advertise | Privacy | Mobile
Web02 | 2.8.141216.1 | Last Updated 13 Mar 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100