Problem description:An error has occurred while establishing a connection to the server. when connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40-cocould not open a connection to SQL Server)
Solution: if the network and database are okay, you can use winform to connect to them. One possible reason is that Sqlserver2000 has not been patched with SP4. You can use the following SQL command to View Details:
Select serverproperty ('productlevel ')
Installing the sp4 patch is a simple step, but there is a small problem here. Sometimes, when installing sp4, you cannot use an SQL account but use a windows Local Account. Therefore, after sp4 is installed, the database cannot enter. The following describes the solution.
1. If the database cannot be opened due to account issues in the Enterprise Manager, delete it and re-register a windows Local Account.
2. Select database instance-> properties-> security tag-> select SQL Server and Windows
3. Select database instance> edit SQL Server Registration attributes> select use SQL Server identity verification to enter the login name and password.
After completing the above steps, you can use the SQL Server account to log on again.