Solved

trigger a notification

Posted on 2006-07-18
4
218 Views
Last Modified: 2010-04-23
Hi, i have a server in vb.net which will monitors a process, once the process is done it will write to the database whether the process is done or not.  Currently we are doing this at the client side, get the client to poll the database table to check the status in an infinite loop and update the client's UI to indicate that processing at server side is done. Are there better ways of polling data to check on a status besides reading the database every loop which my manager dont really like. Maybe some form of auto trigger from the sql server or things like this?
0
Comment
Question by:jaxrpc
4 Comments
 
LVL 8

Accepted Solution

by:
Shakti109 earned 500 total points
Comment Utility

When you say "update the clients UI...", what are you doing?

You CAN put a trigger on this table (on insert) that would take some action after a record was inserted. You could have it look at the items just inserted and if they meet the criteria then do something.

An example of an "on insert" trigger (for sql) is as follows :


set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go

ALTER TRIGGER [NotifyClientTrigger]
   ON  [dbo].[ProcessWatchTable]
   AFTER INSERT
AS
BEGIN
      -- SET NOCOUNT ON added to prevent extra result sets from
      -- interfering with SELECT statements.
      SET NOCOUNT ON;
  DECLARE @Process_Name varchar(20);
  DECLARE @Process_Running int ;

  select
  @Process_Name,
  @Process_Running
  from inserted

     if  
         @Process_Running = 1
        -- Take some action
   
END
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

772 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now