473,385 Members | 1,798 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Trigger process when a file arrives

Hi

I've a requirement to run a database update process whenever an XML
file is copied into a particular directory.

I could create a program to run as a Windows Service that keeps looking
into the directory, but that seems rather inefficient. Is there a
better way of triggering a process when a file arrives?

I'd appreciate any suggestions.

John South
www.WhereCanweGo.com
Pangbourne UIK

Feb 15 '06 #1
4 1699
Try the FileSystemWatcher class.

"JohnSouth" <Jo**********@gmail.com> wrote in message
news:11**********************@g43g2000cwa.googlegr oups.com...
Hi

I've a requirement to run a database update process whenever an XML
file is copied into a particular directory.

I could create a program to run as a Windows Service that keeps looking
into the directory, but that seems rather inefficient. Is there a
better way of triggering a process when a file arrives?

I'd appreciate any suggestions.

John South
www.WhereCanweGo.com
Pangbourne UIK

Feb 15 '06 #2
What kind of performance do u need and why recomended FileSystemWatcher isn't
suitable for you?
I've a requirement to run a database update process whenever an XML
file is copied into a particular directory.
I could create a program to run as a Windows Service that keeps looking
into the directory, but that seems rather inefficient. Is there a
better way of triggering a process when a file arrives?


--
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
Feb 15 '06 #3
John,

As others have pointed out, you should use the FileSystemWatcher class.
Running a service is not inefficient, really. If anything, you can run the
service and then have your FileSystemWatcher instance wait for events from
the file system.

Also, you might want to check out BizTalk, as it has an adapter for
watching a directory for files.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"JohnSouth" <Jo**********@gmail.com> wrote in message
news:11**********************@g43g2000cwa.googlegr oups.com...
Hi

I've a requirement to run a database update process whenever an XML
file is copied into a particular directory.

I could create a program to run as a Windows Service that keeps looking
into the directory, but that seems rather inefficient. Is there a
better way of triggering a process when a file arrives?

I'd appreciate any suggestions.

John South
www.WhereCanweGo.com
Pangbourne UIK

Feb 15 '06 #4
Thanks All
That's just what I need.

John South
www.WhereCanweGo.com
Pangbourne UK

Feb 17 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Terri | last post by:
I'm using xp_cmdshell to output a text file from a trigger like this CREATE TRIGGER ON tblApplications FOR INSERT AS DECLARE @FirstName varchar(75) DECLARE @LastName varchar(75) Declare...
9
by: Lauren Quantrell | last post by:
Is there a way to create a text file (such as a Windows Notepad file) by using a trigger on a table? What I want to do is to send a row of information to a table where the table: tblFileData has...
9
by: Martin | last post by:
Hello, I'm new with triggers and I can not find any good example on how to do the following: I have two tables WO and PM with the following fields: WO.WONUM, VARCHAR(10) WO.PMNUM,...
33
by: coosa | last post by:
I have a table: ---------------------------------------------------- CREATE TABLE CATEGORY ( CATEGORY_ID INTEGER IDENTITY(1,1) NOT NULL, CATEGORY_NAME VARCHAR(40) NOT NULL,...
5
by: Dave Sisk | last post by:
Hey folks: I'm trying to do this: CREATE TRIGGER datawhse.emp_ti AFTER INSERT ON emp REFERENCING NEW AS n FOR EACH ROW MODE DB2ROW BEGIN DECLARE v_rrn DECIMAL(15,0);
6
by: m | last post by:
Hello, I have an application that processes thousands of files each day. The filenames and various related file information is retrieved, related filenames are associate and placed in a linked...
4
by: Peter Lin | last post by:
Dear all; I need to monitor a xml file so that I can update my data in hashtable, but the problem is it will trigger more than one event for a lastwrite action(I trigger this action by add...
9
by: Ots | last post by:
I'm using SQL 2000, which is integrated with a VB.NET 2003 app. I have an Audit trigger that logs changes to tables. I want to apply this trigger to many different tables. It's the same trigger,...
11
by: tracy | last post by:
Hi, I really need help. I run this script and error message appeal as below: drop trigger log_errors_trig; drop trigger log_errors_trig ERROR at line 1: ORA04080: trigger 'LOG_ERRORS-TRIG'...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.