I am trying to find possible reasons why my application cannot connect to the db server.
I have a windows service that connects to the database when it starts. The service runs on machines with a reliable wired network connection. It is installed with automatic start, so it usually starts when windows are made, and in almost all cases it works fine.
However, with one set of XP computers (with which I do not control), the database connection fails when the service starts with Windows. The standard exception is excluded:
System.Data.SqlClient.SqlException: An error occurred while creating a connection to the server. when connecting to SQL Server 2005, this failure may be caused by the fact that in the default settings SQL Server does not allow remote connections. (provider: SQL network interfaces, error: 26 - Search error Specified server / instance)
On these machines, if the user is logged in and starts the service manually, he connects to the database correctly, which is rather strange. Therefore, I think the problem is when starting Windows:
- The service starts before the network connects.
- The service starts before the machine can connect to DNS to resolve the server name (if it is, like the db server names).
- There is a policy / firewall / etc on the computer that initially prevents outgoing connections.
- something else...
, , - . , , , , , , - , - logon script.
, , , , . , .
, : - , , ? : , , ?
, , , , . :
- "ipconfig/all" ( , )
- ping IP- ( , )
- ping
- HKLM, ( HKLM)
- SQL- ( , )
- .
, , - . ... - ?
, . , Local System db, . , .
UPDATE: Win XP.
UPDATE: 26