Welcome to Dream.In.Code
Become an Expert!

Join 136,933 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,851 people online right now. Registration is fast and FREE... Join Now!




Scheduling Advice

 
Reply to this topicStart new topic

Scheduling Advice

PsychoCoder
27 Mar, 2008 - 10:56 AM
Post #1

using DIC.Core;
Group Icon

Joined: 26 Jul, 2007
Posts: 8,998



Thanked: 126 times
Dream Kudos: 8625
Expert In: VB, VB.Net, C#, SQL, ASP, ASP.Net, Web Development, HTML, CSS, Win32 API, Javascript, mySQL, J#, Boo.Net

My Contributions
I am currently creating a console application for the company I work for. The job of this small application is to handle tasks at a certain time each day; send email notifications, handle reoccurring billing, certain logging functionality, etc. I'm not wanting to have it run 24/7 and am wanting to schedule it to run at certain times of the day for certain activities. I want it to open, perform the tasks (according to the command line arguments passed to it), log the activity in the System Event Log, then close.

Now to my question. Would it be better to use the built in scheduling agent in Windows, create a SQL DTS Package, or possibly use a 3rd party scheduling program to schedule this. I am kind of leaning towards the SQL DTS Package, but am open to ideas and suggestions.

Anyone got any suggestions I can run with?
User is offlineProfile CardPM
+Quote Post

marcells23
RE: Scheduling Advice
27 Mar, 2008 - 11:16 AM
Post #2

D.I.C Head
Group Icon

Joined: 22 Aug, 2007
Posts: 134



Thanked: 3 times
Dream Kudos: 125
My Contributions
IMO if you're on server 2003, just use the built in scheduler..It would probably be more reliable as its Native to the OS.
User is offlineProfile CardPM
+Quote Post

PsychoCoder
RE: Scheduling Advice
27 Mar, 2008 - 11:40 AM
Post #3

using DIC.Core;
Group Icon

Joined: 26 Jul, 2007
Posts: 8,998



Thanked: 126 times
Dream Kudos: 8625
Expert In: VB, VB.Net, C#, SQL, ASP, ASP.Net, Web Development, HTML, CSS, Win32 API, Javascript, mySQL, J#, Boo.Net

My Contributions
It's a 2003 Server, thanks for the advice. I'm also going to check into a DTS package and see which is more efficient. If I go with a DTS Package Ill have to change it once I make the upgrade to SQL 2005 as DTS doesn't exist in 2005 so thats something for me to think about as well.
User is offlineProfile CardPM
+Quote Post

PsychoCoder
RE: Scheduling Advice
28 Mar, 2008 - 06:10 AM
Post #4

using DIC.Core;
Group Icon

Joined: 26 Jul, 2007
Posts: 8,998



Thanked: 126 times
Dream Kudos: 8625
Expert In: VB, VB.Net, C#, SQL, ASP, ASP.Net, Web Development, HTML, CSS, Win32 API, Javascript, mySQL, J#, Boo.Net

My Contributions
No one else has any input on this topic. Like I said, it's not a programming question, just looking for some input smile.gif
User is offlineProfile CardPM
+Quote Post

1lacca
RE: Scheduling Advice
28 Mar, 2008 - 07:06 AM
Post #5

code.rascal
Group Icon

Joined: 11 Aug, 2005
Posts: 3,822



Thanked: 11 times
My Contributions
If it has to be a console app, the native scheduler should be nice.
If it is not a requirement, running them as a service might work as well.
User is offlineProfile CardPM
+Quote Post

PsychoCoder
RE: Scheduling Advice
28 Mar, 2008 - 07:14 AM
Post #6

using DIC.Core;
Group Icon

Joined: 26 Jul, 2007
Posts: 8,998



Thanked: 126 times
Dream Kudos: 8625
Expert In: VB, VB.Net, C#, SQL, ASP, ASP.Net, Web Development, HTML, CSS, Win32 API, Javascript, mySQL, J#, Boo.Net

My Contributions
I cant believe I never thought of a Windows Service. I think that may be a route I go, at least I'm going to look at it. Since Ive never done a Windows Service, you can pass command line arguments to it right?
User is offlineProfile CardPM
+Quote Post

1lacca
RE: Scheduling Advice
28 Mar, 2008 - 08:20 AM
Post #7

code.rascal
Group Icon

Joined: 11 Aug, 2005
Posts: 3,822



Thanked: 11 times
My Contributions
I think yes, according to the article: Passing parameters to C# Windows Services.
User is offlineProfile CardPM
+Quote Post

skaoth
RE: Scheduling Advice
28 Mar, 2008 - 08:39 AM
Post #8

D.I.C Regular
Group Icon

Joined: 7 Nov, 2007
Posts: 344



Thanked: 10 times
Dream Kudos: 100
My Contributions
Here is a blog entry talking about this very issue.
http://weblogs.asp.net/jgalloway/archive/2.../24/428303.aspx

What it sounds like you need is an equivalent to a cron job in linux. I don't know what the equivalent is in windows. It is probably the default task scheduler.
User is offlineProfile CardPM
+Quote Post

1lacca
RE: Scheduling Advice
29 Mar, 2008 - 06:47 AM
Post #9

code.rascal
Group Icon

Joined: 11 Aug, 2005
Posts: 3,822



Thanked: 11 times
My Contributions
Very good find skaoth, and the comments are even better after the entry! There are some really good thoughts on when you should use a service and when a scheduled task, since both have their cons and pros.
User is offlineProfile CardPM
+Quote Post

PsychoCoder
RE: Scheduling Advice
29 Mar, 2008 - 09:50 AM
Post #10

using DIC.Core;
Group Icon

Joined: 26 Jul, 2007
Posts: 8,998



Thanked: 126 times
Dream Kudos: 8625
Expert In: VB, VB.Net, C#, SQL, ASP, ASP.Net, Web Development, HTML, CSS, Win32 API, Javascript, mySQL, J#, Boo.Net

My Contributions
That is a great find indeed. I think for the time being, since at this exact point it only has a single task: Send email notifications once a day. Eventually it will handle many tasks, email notifications, reoccurring billing tasks, advanced logging, etc. I think at that point I may want to look at a Windows Service (well I'm going to be developing the service concurrently with the Console Application). But since for the time being it will handle but a single task I will go with the Console Application as a scheduled task.
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/3/08 10:43PM

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month