Thanks you all for the support. I finally found the issue. Chris Dunaway was
right after all. The service depends on SQL Server to be started - if the SQL
Server is not started, then the error occurs. By some freak coincidence, SQL
Server was turned off when I was performing the reboot test - and it was
turned on when I started it manually.
I caught this condition when the service failed to start manually. Anyways,
I have added better error handling in my code - now I get the error "SQL
Server does not exist or access is denied". This is a more acceptable error
and allows me to troubleshoot.
Once again, thanks to you all.
Ajay Mirmira
"amirmira" wrote:
I have a Windows Service developed in VB.NET that attempts to connect to a
database as soon as the service starts. I have no problem when I start the
service manually - but when I restart the computer that hosts the service, I
get a Null Reference Exception when I try to connect to the database (I have
set the service to start automatically). Any ideas why this is happening?
Thanks in advance.
Ajay Mirmira