Click here to Skip to main content
15,896,207 members
Home / Discussions / C#
   

C#

 
GeneralRe: Casting to inhering type from inherited type Pin
livez3-Jun-08 1:41
livez3-Jun-08 1:41 
GeneralRe: Casting to inhering type from inherited type PinPopular
leppie3-Jun-08 1:43
leppie3-Jun-08 1:43 
GeneralRe: Casting to inhering type from inherited type Pin
Colin Angus Mackay3-Jun-08 2:30
Colin Angus Mackay3-Jun-08 2:30 
GeneralRe: Casting to inhering type from inherited type Pin
leppie3-Jun-08 3:19
leppie3-Jun-08 3:19 
GeneralRe: Casting to inhering type from inherited type Pin
Colin Angus Mackay3-Jun-08 2:32
Colin Angus Mackay3-Jun-08 2:32 
GeneralRe: Casting to inhering type from inherited type Pin
livez3-Jun-08 3:55
livez3-Jun-08 3:55 
GeneralRe: Casting to inhering type from inherited type Pin
Russell Jones3-Jun-08 4:35
Russell Jones3-Jun-08 4:35 
QuestionService Starting Problem! Pin
backSlashZero2-Jun-08 22:47
backSlashZero2-Jun-08 22:47 
I have created a windows service to send email on daily basis. It has a timer object that fires an event after 24 hours,

private System.Timers.Timer timer = new System.Timers.Timer (86400000); 


In timer event I do my working i.e. I send my emails, something like this:

private void OnTimedEvent(object source, System.Timers.ElapsedEventArgs e) 
{
	eventLog1.WriteEntry("Calling web service for Sending Reminders on " + DateTime.Now.ToLongDateString());
	if (EmailObj.SendReminder()) // if sending email is sussful
	{
		eventLog1.WriteEntry("The operation was successfully completed on " + DateTime.Now.ToLongDateString());;
	}
	else
	{
		eventLog1.WriteEntry("There was some error, the operation failed on " + DateTime.Now.ToLongDateString());;
	}

	if (DateTime.Today.Day == 1)
	{
		// first date of month; send emails	
	}
}


The problem is, I have installed the service on Windows server 2003, but the service starts and stops immediately with the message

“The MyServiceName service on Local Computer started and then stopped. Some services stop automatically if they have no work to do, for example, the Performance Logs and Alerts service”

I can see the event log entries that I did on OnStart event of the service; also the service is working fine on Windows XP.

Please help me I have to run this service on MS Windows server 2003 forever to send emails on daily basis,

cout << "\0";
// its backSlashZero

AnswerRe: Service Starting Problem! Pin
N a v a n e e t h2-Jun-08 22:59
N a v a n e e t h2-Jun-08 22:59 
GeneralRe: Service Starting Problem! Pin
backSlashZero3-Jun-08 0:17
backSlashZero3-Jun-08 0:17 
AnswerRe: Service Starting Problem! Pin
#realJSOP2-Jun-08 23:27
professional#realJSOP2-Jun-08 23:27 
GeneralRe: Service Starting Problem! Pin
backSlashZero3-Jun-08 0:08
backSlashZero3-Jun-08 0:08 
GeneralRe: Service Starting Problem! Pin
#realJSOP3-Jun-08 0:33
professional#realJSOP3-Jun-08 0:33 
GeneralRe: Service Starting Problem! Pin
backSlashZero3-Jun-08 0:52
backSlashZero3-Jun-08 0:52 
Questionhelp in binding data to dropdowmlist Pin
csp2-Jun-08 22:44
csp2-Jun-08 22:44 
QuestionError stop Http Listener Pin
George_George2-Jun-08 21:58
George_George2-Jun-08 21:58 
AnswerRe: Error stop Http Listener Pin
N a v a n e e t h2-Jun-08 22:26
N a v a n e e t h2-Jun-08 22:26 
GeneralRe: Error stop Http Listener Pin
George_George2-Jun-08 22:45
George_George2-Jun-08 22:45 
GeneralRe: Error stop Http Listener Pin
N a v a n e e t h2-Jun-08 22:51
N a v a n e e t h2-Jun-08 22:51 
GeneralRe: Error stop Http Listener Pin
George_George2-Jun-08 23:01
George_George2-Jun-08 23:01 
GeneralRe: Error stop Http Listener Pin
N a v a n e e t h2-Jun-08 23:12
N a v a n e e t h2-Jun-08 23:12 
GeneralRe: Error stop Http Listener Pin
GDavy2-Jun-08 23:08
GDavy2-Jun-08 23:08 
GeneralRe: Error stop Http Listener Pin
N a v a n e e t h2-Jun-08 23:12
N a v a n e e t h2-Jun-08 23:12 
GeneralRe: Error stop Http Listener Pin
GDavy2-Jun-08 23:20
GDavy2-Jun-08 23:20 
GeneralRe: Error stop Http Listener Pin
George_George2-Jun-08 23:42
George_George2-Jun-08 23:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.