Click here to Skip to main content
12,690,140 members (31,302 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: VB VB.NET
Hi

I currently have a process when a user clicks a button on the page the program fetches a file from via Ftp and then reads the file and inserts the data into a database table.

I would like to know how would I be able to let this process run automatically at a certain hour? lets say 12:05am daily
Posted 9-Dec-12 21:22pm
isi19520
Comments
AnkitGoel.com 10-Dec-12 4:45am
   
you have to write a job in sql server which calls a stored procedure and that stored procedure should download the file from ftp and insert the contents into database.
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

You can use the Windows Service which is designed for similar purposes and bundled with Windows; you can use it on different levels. It is called Window Task Scheduler, see http://en.wikipedia.org/wiki/Windows_Task_Scheduler[^].

First, you can schedule events using command-line utilities AT.EXE or CSHTASKS.EXE (which is replacing AT.EXE), see:
http://en.wikipedia.org/wiki/At_%28Windows%29[^],
http://en.wikipedia.org/wiki/Schtasks[^],
http://technet.microsoft.com/en-us/library/bb490866.aspx[^],
http://msdn.microsoft.com/en-us/library/windows/desktop/bb736357%28v=vs.85%29.aspx[^].

And you also can use Window Task Scheduler API, please see:
http://msdn.microsoft.com/en-us/library/windows/desktop/aa383614%28v=vs.85%29.aspx[^],
http://msdn.microsoft.com/en-us/library/windows/desktop/aa383608%28v=vs.85%29.aspx[^].

To see how can you use it with .NET, see this CodeProject article: A New Task Scheduler Class Library for .NET[^].

—SA
  Permalink  
Comments
Abhinav S 11-Dec-12 0:43am
   
5!
   
Thank you, Abhinav.
--SA
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

You can create a scheduled task by using the CSTaskScheduler task[^].
  Permalink  
Comments
   
Yes, a 5.
--SA
Abhinav S 11-Dec-12 0:52am
   
Thank you SA.

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web01 | 2.8.170117.1 | Last Updated 11 Dec 2012
Copyright © CodeProject, 1999-2017
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