Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Fire Scheduled Task 2

Status
Not open for further replies.

acent

Technical User
Feb 17, 2006
247
US
Greetings.

I have an intranet site that I upload a CSV file to. After the file, the website does some cool stuff that essentially synchronizes two databases to have the same information - which takes a couple minutes. This synchronization is also performed every hour by a scheduled task (VBScript).

What I want, or better said, what I think I want, is to have my VB.NET website fire off the scheduled task after the file is uploaded, but not have the website wait for the scheduled task to finish before refreshing the page and allowing the user to go on their merry way.

Is this possible, and is there a better way?

"If it's stupid but works, it isn't stupid."
-Murphy's Military Laws
 
This is not the job for a website. This should be done with a scheduled windows service. You can have the service moitor a folder on the server. When it detects that a new file was uploaded, you can have it kick off your db sync process. This way, it will not interfere with the website that is accessing the data.
 
I think I'm finding better stuff!

Thanks jbenson001 for the idea. Do you happen to have a favored web page that might teach me how to burn this bridge?

Thanks!

"If it's stupid but works, it isn't stupid."
-Murphy's Military Laws
 
I don't have a specific site, buy you can google around, there is plenty of info online. Also look in VS help and look at directory monitoring.
 
add a windows service project to your solution.
add a file system watcher to the service.
configure the watcher.
add a project installer to the windows service project.
compile.
install and start the service using .bat script
Code:
"c:\windows\microsoft .net framework\[version]\installutil.exe" [name of service].exe
net start [name of service]
the name of the assembly and the name of service do need to be the same, but it makes it easier to maintain.

Jason Meckley
Programmer
Specialty Bakers, Inc.

faq855-7190
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top