Click here to Skip to main content
13,089,818 members (47,324 online)
Rate this:
Please Sign up or sign in to vote.
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 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
Top Experts
Last 24hrsThis month

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