Click here to Skip to main content
15,868,016 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
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
Comments
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

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.
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900