Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I need to create an application that runs late every night, and processes some files (where there can be 0 to n files).

 

I really don't need an interface.

 

I'm looking at options. I was investigating a Windows Service, except that it doesn't seem to have any built in scheduling functionality. Am I missing something? Or should I go ahead and build a interface-less VB.NET app? OR are there other options I haven't thought of yet???

Posted

You can create a windows service with a timer to execute code every certain period of time. Thus acheiving your goals (no interface, and scheduled)

 

Hope this helps,

Dream as if you'll live forever, live as if you'll die today
Posted

and whats the problem with setting the timer to 60,000 seconds?(assuming the timer can handle that much - which i am sure it can)

 

If you dont want to have the timer looping that much, have the timer count to 60 seconds, every time it reaches 60, add 1 to an integer. If integer = 1440 (minutes in day) - then activate the event, and set the integer to 0.

  • 7 months later...
Posted

sam,

 

what did you wind up going with here?

I have an app with no true interface that I want to run nightly or possibly weekly.

Did you go with the task scheduler?

 

Do you just tell the scheduler the name of the .exe?

Wanna-Be C# Superstar
Posted
Good Deal. I am testing out something like that right now. It is a win app that had a GUI but I just took the relevant subs and I call them from the Form_Load event. Seems like a hack but I think it is working. I suppose I could strip out all of the GUI controls but I am always going to need to have that form in there to access the Load event, right?
Wanna-Be C# Superstar
  • *Experts*
Posted

You can use the Windows Task Scheduler (as mentioned).

An alternate approach, available if you're using SQL Server, is to use a sqltask. It works similarly to the Windows Task Scheduler (very robust) and has the advantage that you can easily change the scheduling (turn on/off, time of day, etc.).

 

Interfacing with the Windows Task Scheduler, in my past experience, has been difficult. Interfacing to the sqltask scheduler is a breeze. And, since you're loading data into SQL (SQL Server?), it would make sense to make this a sql job.

 

-ner

"I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
Posted
Interfacing with the Windows Task Scheduler, in my past experience, has been difficult

 

Not sure what you mean by this. Do you mean programatically? I am just setting it up through the GUI and it seemed really simple.

 

Unfortunately I am in Oracle. Seems like I switch back and forth about every three weeks. That's good and bad at the same time.

Wanna-Be C# Superstar
  • *Experts*
Posted

Yes, I meant programmatically. If you have the need, sql tasks are easier to program against. Plus, since this is technically an sql task, it seems fitting to go there.

 

But, a windows task is super easy to setup as well and works quite well. Just offering up another option since many probably don't know that SQL Server supports setting up scheduled tasks.

 

-ner

"I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...