473,387 Members | 1,515 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,387 software developers and data experts.

A problem with Filewatch or something.

Hello all!

I am having problem wih filewatch, I think. Basicly I have a trigger that
creates a file. Filewatch looks for a modified date on the file, than when
it see's it, it should pop up a message box. The problem it pop's up 3 or 4
message boxes. I just need it once.Here some code from app 1 that will
execute the store procedure.

Private Sub ON_Click_1(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnON.Click
On()
End Sub

Here is the "On" store procedure.

REATE PROCEDURE [DBO].[On] AS
UPDATE OnOff
SET Switch = '1'
WHERE Switch = '0'
GO

Here is the trigger to create the file

CREATE TRIGGER [OutTxt] ON dbo.OnOff
FOR INSERT, UPDATE
AS
DECLARE @Switch varchar,
@OutCmd varchar(1000),
@OLEResult int,
@FileID int
--BEGIN
--EXEC master..xp_cmdshell 'del >E:\Switch.txt'
--End
BEGIN
SET @Bet = (SELECT MIN (DISTINCT Switch) FROM Inserted)
SET @OutCmd = 'echo' + ' ' + @Switch + ' >E:\Switch.txt'
END

BEGIN
EXEC master..xp_cmdshell @OutCmd
END
Now the File watch on app B.

Private Sub FileSystemWatcher1_Changed(ByVal sender As System.Object, ByVal
e As System.IO.FileSystemEventArgs) Handles FileSystemWatcher1.Changed

MessageBox.Show("All Switches Are On", "Switch")

The properties for filewatch are:
EnableRasingEvents True
Filter switch.txt
IncludeSubdirectiories False
NotifyFilter LastWrite
Sync Object MainFrm

Sorry so long, but this is a real head scratcher for me. I debug, and it
seems it keeps looping the file watch call.

TIA!!

Rudy
Sep 23 '06 #1
0 1148

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

Similar topics

68
by: Marco Bubke | last post by:
Hi I have read some mail on the dev mailing list about PEP 318 and find the new Syntax really ugly. def foo(x, y): pass I call this foo(1, 2), this isn't really intuitive to me! Also I...
3
by: Sony Antony | last post by:
Hello: ( Please redirect me to the correct list if this is not where I m supposed to ask this question ) Our application essentially sends xml 'commands' to another system. These commands...
4
by: Wenslauw | last post by:
A weird thing is going on. I don't understand it. I made a table: <TABLE border=0 cellpadding=0 cellspacing=0> <TR> <TD><A href="something"><IMG src="Welkom.gif" width="51"...
8
by: Penny | last post by:
Hi all, My browser throws this Select Case block back at me pointing out a syntax error on the line: 'Case < 251', between the word 'Case' and the '<' symbol. *************************** ...
27
by: C Gillespie | last post by:
Dear All, Hopefully I have a simple problem. Basically, I just want to alter some text with JS. Here is some of my test code: <snip> <script type="text/javascript"> var tmp='a';
6
by: rh0dium | last post by:
Hi all, Basically I have a bunch of pluggins in a directory (METDIR). For each one of these templated pluggins I want to do a specific routine. Let's start with a basic template file...
7
by: teachtiro | last post by:
Hi, 'C' says \ is the escape character to be used when characters are to be interpreted in an uncommon sense, e.g. \t usage in printf(), but for printing % through printf(), i have read that %%...
2
by: Martin Høst Normark | last post by:
Hi everyone Has anyone got the least experience in integrating the Digital Signature with an ASP.NET Web Application? Here in Denmark, as I supose in many other countries, they're promoting...
3
by: Rudy | last post by:
Hello all! This is what I want to do, looking the for the best way to do this. I have a text file that gets created and placed in a folder. I would like to have a watch for that file when it pops...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
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:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.