I'll get right to the point, I'm creating a Windows Service (C#), and so far things are working up to the point where I want to connect to Oracle 9i (9.2.1 to be specific).
I first tested my connection string out in a Windows Application first, and that worked. So then my next step was just to copy and paste that code into the Windows Service OnStart() sub. But when I build and install the service, it says that it can't start because it has no tasks to do. Well that's just not true, i want it to talk to the oracle database and add a certain value into it.
Any ideas on how abouts I can resolve this
If you wish to see some code, request it and I'll make sure you get some. But I'm sure it if worked in my Windows app, it should work in the Windows service...shoudln't it

Windows Services + Oracle Connection
AdrianB79
Perfect, I haven't tried it yet, but it looks like this could work! Thanks my friend
SOTY_Programmer
Basquiat
Start the thread from the OnStart() Event
Sample Code:
=========================================================
private System.Threading.Thread workerThread = null;
protected override void OnStart(string[] args)
{
if ((workerThread == null) || ((workerThread.ThreadState & (System.Threading.ThreadState.Unstarted | System.Threading.ThreadState.Stopped)) != 0))
{
workerThread = new Thread(new ThreadStart("name of the function"));
workerThread.Start();
}
}
protected override void OnStop()
{
if ((workerThread != null) && (workerThread.IsAlive))
{
Thread.Sleep(3000);
workerThread.Abort();
}
}
Yeago
Is this something no one has ever seen or am I doing the impossible. Any advice would be nice at this point and time. Thanks! :)