Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old December 24th, 2005, 08:13 PM
Authorized User
 
Join Date: Dec 2005
Location: San Nicolas, Buenos Aires, Argentina.
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to arielote Send a message via MSN to arielote Send a message via Yahoo to arielote
Default Windows services in C#

Hi everybody!

Of course I am newbie in C#, but my boss asked me for an "piece of cake" application.
Here the problem:
1. I need to develop an application that runs as service, will be started, stopped, paused from control panel
2. This service will read OnStart some information from windows registry.
3. One of this info will the an especific hour when it has to do some task.
3. The service will be checking the actual time untill the specified hour in which has to make some task.
4. The tash is to login in an SQL2K database and move some records from a table to other, using an especific filter.

Could somebody send me some tips, and if possible some example code, about how to develop the service and where I have to call the module that will perform the tasks in the database.

Thank you very much and Merry Christmas

---
Ariel Folonier
San Nicolas
Argentina
__________________
---
Ariel Folonier
San Nicolas
Argentina
Reply With Quote
  #2 (permalink)  
Old December 27th, 2005, 06:13 PM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

You can certainly do that; depending on your version of C# / Visual Studio, there should be a Windows Service template. That project type allows you to create an application that you can register in the Windows Services panel. Such an application can run in the background and listen to events.

One such event could come from a Timer object to allow you to run code at a specified interval.

Google has lots of results for "windows service" c#...

Maybe you shouldn't do this as a Windows Service, but directly in SQL Server. If you have simple logic, you could schedule a stored procedure. For more complex operations, you could use DTS and then schedule DTS packages.

HtH,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
windows services rana018 C# 0 August 16th, 2006 05:13 AM
Windows services.. Please Help me urgently Zeeshan C# 0 July 10th, 2005 11:01 AM
windows services marclena General .NET 0 June 30th, 2004 11:22 AM
Windows Services rodmcleay General .NET 1 June 29th, 2004 01:34 AM



All times are GMT -4. The time now is 05:59 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.