Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old December 24th, 2005, 08:13 PM
Authorized User
Join Date: Dec 2005
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
Ariel Folonier
San Nicolas
Old December 27th, 2005, 06:13 PM
Imar's Avatar
Wrox Author
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts

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.


Imar Spaanjaars
Everyone is unique, except for me.

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

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