Click here to Skip to main content
15,881,248 members
Home / Discussions / C#
   

C#

 
GeneralRe: Error starting window service Pin
himanshu256123-Jun-09 23:39
himanshu256123-Jun-09 23:39 
GeneralRe: Error starting window service Pin
obrix_activex24-Jun-09 0:19
obrix_activex24-Jun-09 0:19 
GeneralRe: Error starting window service Pin
himanshu256124-Jun-09 0:43
himanshu256124-Jun-09 0:43 
AnswerRe: Error starting window service Pin
dan!sh 23-Jun-09 22:21
professional dan!sh 23-Jun-09 22:21 
GeneralRe: Error starting window service Pin
obrix_activex24-Jun-09 0:23
obrix_activex24-Jun-09 0:23 
AnswerRe: Error starting window service Pin
PIEBALDconsult24-Jun-09 4:58
mvePIEBALDconsult24-Jun-09 4:58 
GeneralRe: Error starting window service Pin
obrix_activex24-Jun-09 23:04
obrix_activex24-Jun-09 23:04 
GeneralRe: Error starting window service Pin
PIEBALDconsult25-Jun-09 4:23
mvePIEBALDconsult25-Jun-09 4:23 
For my Windows Services, I set the database connections in the constructor.

Ideally your OnStart and OnStop methods would only be:

public void OnStart()
{
    timer1.Start() ;
}
 
public void OnStop()
{
    timer1.Stop() ;
}


I add some logging as well, but the point is that you want to be doing very little in these methods; it's not the place to be setting up a database connection.


0) Set up the connection in the constructor
1) Start the timer in OnStart
2) Stop the timer in OnStop
3) In the timer callback method (LLPlusProcess?): open the connection, use it, and close it.


After further reading of your code, I think you may have bigger problems, but start with that and see how it goes.
QuestionHow to have a FileSystemWatcher fire only 1 change event? Pin
Super Lloyd23-Jun-09 20:56
Super Lloyd23-Jun-09 20:56 
AnswerRe: How to have a FileSystemWatcher fire only 1 change event? Pin
Super Lloyd23-Jun-09 21:14
Super Lloyd23-Jun-09 21:14 
AnswerRe: How to have a FileSystemWatcher fire only 1 change event? Pin
Luc Pattyn23-Jun-09 21:16
sitebuilderLuc Pattyn23-Jun-09 21:16 
GeneralRe: How to have a FileSystemWatcher fire only 1 change event? Pin
Super Lloyd23-Jun-09 21:25
Super Lloyd23-Jun-09 21:25 
QuestionError In Connection Pin
rhtbhegade23-Jun-09 20:40
rhtbhegade23-Jun-09 20:40 
AnswerRe: Error In Connection Pin
padmanabhan N23-Jun-09 20:56
padmanabhan N23-Jun-09 20:56 
GeneralRe: Error In Connection Pin
rhtbhegade23-Jun-09 21:00
rhtbhegade23-Jun-09 21:00 
GeneralRe: Error In Connection Pin
Philip.F23-Jun-09 21:29
Philip.F23-Jun-09 21:29 
GeneralRe: Error In Connection Pin
rhtbhegade23-Jun-09 22:55
rhtbhegade23-Jun-09 22:55 
QuestionHow to get active window event Pin
Jacobb Michael23-Jun-09 19:37
Jacobb Michael23-Jun-09 19:37 
AnswerRe: How to get active window event Pin
Anubhava Dimri23-Jun-09 19:50
Anubhava Dimri23-Jun-09 19:50 
GeneralRe: How to get active window event Pin
Jacobb Michael24-Jun-09 1:18
Jacobb Michael24-Jun-09 1:18 
AnswerRe: How to get active window event Pin
Anubhava Dimri24-Jun-09 2:11
Anubhava Dimri24-Jun-09 2:11 
GeneralRe: How to get active window event Pin
Jacobb Michael24-Jun-09 2:18
Jacobb Michael24-Jun-09 2:18 
GeneralRe: How to get active window event Pin
Anubhava Dimri24-Jun-09 2:32
Anubhava Dimri24-Jun-09 2:32 
QuestionIs there any learning docs for begines? Pin
behesht23-Jun-09 19:01
behesht23-Jun-09 19:01 
AnswerRe: Is there any learning docs for begines? Pin
behesht23-Jun-09 19:22
behesht23-Jun-09 19:22 

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.