Click here to Skip to main content
14,454,912 members
Rate this:
Please Sign up or sign in to vote.
Hi,

Technologies : ASP.Net WebForms or MVC, WebAPI

I need to create "something" to send notifications, kind of reminders, for instance to remind a person his appointment with a doctor.
The dates to send the notifications are saved in a DB

The "something" has to scan the database looking for the notificacionts to be sent, let's every 10 minutes.

I use the word "something" cause I don't have any idea about how to do it by now.

Maybe to create a thread in the global.asax during the Application_start event.
Maybe there's a third party component, I don't know

Thanks in advance!!
pascualito

What I have tried:

nothing yet, starting to explore solutions
Posted
Updated 14-Feb-20 4:28am
Rate this:
Please Sign up or sign in to vote.

Solution 1

If it has to be in ASP.NET, there are various tools you can use to schedule background jobs:
How to run Background Tasks in ASP.NET - Scott Hanselman[^]

However, I would be inclined to create a small console application to scan the database and send the pending notifications, and then use the Windows Task Scheduler to schedule it to run every ten minutes.
   
Rate this:
Please Sign up or sign in to vote.

Solution 2

Hi

I haven't read the first option yet, but I agree with you about the second solution. It's seems to be a very simple solution.

Thanks a lot Richard!!

Pascualito
   
Rate this:
Please Sign up or sign in to vote.

Solution 3

If you are using SQL Server, another option would be to utilize SQL Agent as well as Database Mail

How To Send Mail Using SQL Server: Part 1[^]
   

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




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100