tags:

views:

81

answers:

3

Hi Guys,

I want to send an automatic E-mail based on the date. If the current date is greater than 5 days than the current date field in the table then i need to send an E-mail to the designated person. I am using VS.NET2003/VB.NET/ASP.NET/SQL Sever 2000. Can you guys help me how to get this done(if possible with Code?) Thanks.

+1  A: 

@vik18, I suggest that you give a look to Quartz.NET. Basically, you have to set it up at app start and set up a job that checks for some specific conditions every X time. If there are items, then you trigger some action like for example, sending an email.

Regards.

uvita
A: 

First you write some email code, as done here: http://www.mitchelsellers.com/blogs/articletype/articleview/articleid/29.aspx

Then you connect to your table as seen here: http://msdn.microsoft.com/en-us/library/haa3afyz%28VS.71%29.aspx

Now you combine the two. Loop through your data reader, check your date, and send email. For bonus points filter your sql table for the date as seen here: http://msdn.microsoft.com/en-US/library/ms173545%28v=SQL.90%29.aspx

Lastly, if you want to run as a service instead of a scheduled task: http://www.c-sharpcorner.com/UploadFile/srinivaskotra/CreatingWindowservice10022009111806AM/CreatingWindowservice.aspx

I'd be more specific, but that's a pretty broad question with a lot of details.

Russell Steen
A: 

Hi guys, thanks for your replies. Basically i want to check the Date field in the sql table with Current date. If it is greater than 5 days then i want to send E-mail to 1 person. is it possible to create a schedled task in DTS(i am using sql server2000) to run every day at night? if so can i check this condition in stored procedure and assign that stored procedure to scheduler? Please advise. Thanks.

vik18