473,406 Members | 2,698 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

How to notify?

Hi,
I have a table in MS SQL -
NotifyTBL
==============
ID int Primary Key
SearchID int
OfferID int

this table is populated when a user Insert values in OffersTBL. A trigger
does this automatically. What I want to do is every 30 min to check if there
is a new records in NotifyTBL and if there are I would like to send e-mail
message to users. How could be accomplished that?

Thank you !

Viktor
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.745 / Virus Database: 497 - Release Date: 27.8.2004 a.
Nov 18 '05 #1
2 1047
it will have to be a windows app or a service cause you cannot have a timer
on asp.net which automatically executes the code based on timer interval.

so start with a win app.. do a query on count and keep in memory..
set the timer to relevent interval (i dont know if you can set it to half an
hour but you could have a variable which says how many times the time has
invoked and then do a count again. use SqlCommand.ExecuteScalar() to fetch
the value of count and compare.. if count is greater than you have new
records. if so Create an instance of MailMessage and populate it with your
required data and then use SmtpMail.Send specifying the right smtp server
address.

hth

--

Regards,

Hermit Dave
(http://hdave.blogspot.com)
"Viktor Popov" <vi****@yahoo.com> wrote in message
news:ef**************@TK2MSFTNGP09.phx.gbl...
Hi,
I have a table in MS SQL -
NotifyTBL
==============
ID int Primary Key
SearchID int
OfferID int

this table is populated when a user Insert values in OffersTBL. A trigger
does this automatically. What I want to do is every 30 min to check if there is a new records in NotifyTBL and if there are I would like to send e-mail
message to users. How could be accomplished that?

Thank you !

Viktor
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.745 / Virus Database: 497 - Release Date: 27.8.2004 a.

Nov 18 '05 #2
"Viktor Popov" <vi****@yahoo.com> wrote in
news:ef**************@TK2MSFTNGP09.phx.gbl:
A trigger
does this automatically. What I want to do is every 30 min to check if
there is a new records in NotifyTBL and if there are I would like to
send e-mail message to users. How could be accomplished that?


-Windows Service
-SQL Server Scheduled Event
-Schedule an ASP.NET page to be loaded every 30 minutes to execute the code

#1 is probably your best choice.
--
Lucas Tam (RE********@rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/
Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Alessandro GARDICH | last post by:
Hi to all I have problem with NOTIFY/LISTEN ... I'm writing a C++ application with libpqxx, I thought was a problem of the lib but I try also with a C program using libpq with the same result,...
4
by: Joe Lester | last post by:
I'm using PostgreSQL 7.4.1. I have 140 clients connected on average using libpq. When one client sends "NOTIFY timeclock;" to the server all 140 clients are listening for it. After receiving a...
3
by: Frank van Vugt | last post by:
L.S. Either the docs or I are missing something.... While using libpq I noticed that listen/notify calls were being converted to lowercase. A further look showed that the listen/notify calls...
5
by: Ted Shab | last post by:
Hi, I'm trying to come up with a relatively simple multi-master replication solution. This is for multiple databases that need to be discreet, and change relatively infrequently (10-30 updates...
3
by: Mark Denardo | last post by:
Does anyone have any good VB.NET example code that shows how to use the NOTIFY option using the mciSendString API and then handle the return value. The only examples I can find show the VB way...
5
by: cozsmin | last post by:
hello , as u know wait() and notify() will not thow an exception if the method that calls them has the lock , or esle i misundrestood java :P this is the code that throws (unwanted) ...
1
by: namrataa | last post by:
i have a notify icon for our media player developed in wpf. included files are notify.cs,notify.resx,notify.designer.cs. i have also added a class file called app.cs . now the problem is how...
0
by: namrataa | last post by:
i have the following code for my notify.cs file using System; using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics; using System.Linq; using System.Text; ...
5
by: Peter | last post by:
I have a webpage which creates reports, a report can take few seconds or several minutes to create. This webpage calls a web service which in turn does a remoting call to a windows service and the...
2
by: greyradio | last post by:
I've recently have been given an assignment to do and it seems that notify() does notify() any of the waiting threads. The project entails 10 commuters and two different toll booths. The EZPass booth...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.