Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ADO.NET
ello friends,
 
iam creating one application that i want to mail one file to user at every saturday at 7.00pm
iam searching so much code but not find exactly i wrote find saturday find code but cant set specific timing so please expert help me out here im paste only finding day that is saturday
 DateTime dt=new DateTime ();
if (dt.DayOfWeek == DayOfWeek.Saturday)
{
}
Posted 18-Jan-13 3:32am
Edited 18-Jan-13 5:36am
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

If you are trying to check the current date time you will need to use the Now property.
if (DateTime.Now.DayOfWeek == DayOfWeek.Saturday)
{
    // Send Mail

}
  Permalink  
v2
Comments
Atul Rokade at 18-Jan-13 9:39am
   
BC@CV sir im not checking current datetime actually im only check saturday and if i find saturday then check set time hope u geting my question
BC @ CV at 18-Jan-13 9:47am
   
Well, actually I don't get your question. If you are not checking to see if the current time is Saturday at 7pm what are you checking?
Atul Rokade at 18-Jan-13 10:17am
   
sorry BC@CV im not getting your point early bt now concept is clear ur code work fine thank you
Sergey Alexandrovich Kryukov at 18-Jan-13 19:44pm
   
I wonder, what kind of idiot down-voted this answer? As it is correct, and also because it was difficult to understand OP (who is totally lost), I voted 5.
—SA
BC @ CV at 23-Jan-13 10:54am
   
Thanks SA. I was wondering the same thing.
Sergey Alexandrovich Kryukov at 23-Jan-13 12:02pm
   
Such things happen all the time, it's the best to ignore it.
 
When you see your fault, or the voter explains it and you see the fault, it's the best to say thank you and fix yourself, or provide additional arguments if you stand for your opinion, but this is not the case...
 
—SA
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

The simplest way is to set a Windows Scheduled Task.
  Permalink  
Comments
Atul Rokade at 18-Jan-13 9:57am
   
piebaldconsult--> how can use windows scheduled task?
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

Using CLR and MSSQL SSIS Service its Possible to Send mail on Saturday 7o clock. You can schedule that Process time. I will post the solution soon.
  Permalink  

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 404
1 Nirav Prabtani 389
2 Abhinav S 210
3 PIEBALDconsult 160
4 Dave Kreskowiak 155
0 OriginalGriff 7,580
1 Sergey Alexandrovich Kryukov 6,806
2 Maciej Los 3,919
3 Peter Leow 3,693
4 CHill60 2,742


Advertise | Privacy | Mobile
Web04 | 2.8.140721.1 | Last Updated 18 Jan 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

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