Error tip: "An error has occurred while establishing a connection to the server." When connecting to SQL Server in failure, this is caused by the fact that under the default settings SQL server does not allow remote connections. (provider:named pipes provider, error:40-could not open a connection to SQL Server) "
After loading sqlserver2005 (Express Edition), you will need to go to the next manager (Sqlserver2005_ssmsee.msi) for easy management, Microsoft's official website.
1, open sql2005 remote connection function:
The Configuration tool->sql the server perimeter configuration-> service and the perimeter configuration of the connection-> open the database Engine node under the MSSQLSERVER node, select Remote Connection, and then recommend "use tcp/simultaneously" IP and Named pipes ", after determining, restart the database service.
2, the landing changed into a mixed mode:
Open the Manage Manager-> Windows connection and enter the database-> right click on your data server-> properties->security> Select SQL Server and Windows authentication
3, the new SQL Server method of user name and password:
Maage Manager->security-> Right-click logins-> new login...-> Select SQL Server authentication-> Set login name and password (Confirm password)
It is best to remove the "Enforce password expiration" before the small hook, or every login to modify the password.
/*
Manage manager->windows authentication>new query>sp_password null, ' sa123456 ', ' sa '
This sets a user named SA, the password is: sa123456 users, the next time you log in, you can use SQL Server method,
User name is SA, password is: sa123456 user into the database.
*/
4, after the above three steps, so write the connection string can be successfully entered the database (server=.\\sqlexpress;uid= user name; pwd= password; database=master ");
I have been writing server= (local), fainted.