Click here to Skip to main content
11,643,493 members (69,132 online)
Rate this: bad
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 21:47pm
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
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.

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

  Print Answers RSS
0 OriginalGriff 570
1 484
2 DamithSL 318
3 Afzaal Ahmad Zeeshan 253
4 CPallini 222
0 OriginalGriff 795
1 DamithSL 611
2 Mika Wendelius 494
3 484
4 Afzaal Ahmad Zeeshan 404

Advertise | Privacy | Mobile
Web02 | 2.8.150731.1 | Last Updated 13 Mar 2013
Copyright © CodeProject, 1999-2015
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