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

a safe windows service with fileIO

Hi, I am building a windows service that does the following

1) a System.Timers.Timer elapseed event handler will run code at every
interval, maybe every 2 to 5 minutes or so (i have not decided yet)
2) in the Elapseed event the service will query a table in sql server
and find the 1 oldest row in a table and set the status of that row to
'running'
3) the service will then run a report on the sql server database and
save the results to a excel file. the name of the excel file will come
from that table in sql server. the file is stored on the service's
server's hard drive in c:\folder1
4) the service will then compress the excel file to a zip file of the
same name in c:\folder2. I am using the zipping code from
http://www.icsharpcode.com/OpenSourc.../Download.aspx
5) the excel file in c:\folder1 is deleted
6) the code then uses System.Web.Mail namespace to email the zip file
to the user's email address that was in that table.
7) the code then deletes the zip file.
8) the row in the sql server is then set to 'finished'
9) if there is an error somewhere the row is set to 'failed'

I am just wondering if I have done anything unthreadsafe or file.io
safe. Can you tell me what I can be missing. Do i need to use lock{}
or something?

Nov 17 '05 #1
0 1232

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

Similar topics

9
by: Jody Gelowitz | last post by:
I am trying to find the definition of "Safe Printing" and cannot find out exactly what this entitles. The reason is that I am trying to print contents from a single textbox to no avail using the...
16
by: Jon | last post by:
Hi there, In many of my sites I have code like: <SCRIPT language="JavaScript" type="text/javascript"> <!-- user = "USER"; isp = "DOMAINNAME.XXX"; document.write('<a href=\"mailto:' + user +...
0
by: Visual Systems AB \(Martin Arvidsson\) | last post by:
Hi! I am trying to create a windows service that will add and remove items from outlooks itemlist. But when i create the outlook application instance i get the message "Rejected Safe Mode...
2
by: Matt Theule | last post by:
I need to be able to allow users to drag files to a list box on a web page. To this end, I created a Windows Control and hosted it in a WebForm. When the file is dropped onto the listbox, the...
0
by: Steven Smith | last post by:
Hi guy's I've hit a bit of a sticking point, I'm sure this is simple enough but I just can't get my head around it and I'm looking for a bit of direction. When dealing with FileIO up until now I...
3
by: Amjad | last post by:
Hi, I just wrote a test Windows Service that creates a text file on startup (please see my code below). The file is never created. Protected Overrides Sub OnStart(ByVal args() As String) Dim...
3
by: ian_jacobsen | last post by:
First let me start by saying that this problem is not consistently reproducible. I have a windows service that creates reports for a group of entities. This service can process multiple groups at...
0
by: =?Utf-8?B?bWFnZWxsYW4=?= | last post by:
Hi All, I have the following: FileIO.FileSystem.CopyDirectory(strFromString, strLocString, FileIO.UIOption.AllDialogs) Q: How do I access the UI that is presented and re-positon the x,y...
1
by: =?Utf-8?B?bWFnZWxsYW4=?= | last post by:
hi all, I have a button (stopcopy) that I want the user to cancel out of a long file copying operation. I'm not clear what I should "adding" in the sub to make this happen besides & return....
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
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...

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.