Solved

trigger a notification

Posted on 2006-07-18
4
222 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
ID: 17129717

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
VB.net Open Folder in Windows Explorer 3 97
Help with converting xml file to excel using VB.NET 3 30
VB.NET Inline If statement 4 38
Need help with another query 10 34
1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

685 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