Failed using IP to connect to SQL Server or configured as a connection string
Scenario One: when in Webconfig used in Files
<add key= "ConnectionString" value= "server=127.0.0.1;database= database name uid=sa;pwd=1"/> To connect to the database, and found that the landing is not normal landing, There was a whole bunch of mistakes;
Scenario Two:
Or, when connecting to SQL Server, enter IP as follows:
Hint that you cannot connect or connect incorrectly.
Solution :
First step: Check TCP/IP did the protocol start:
In the Start menu, locate the Configuration tool at Microsoft SQL Server 2005 Open SQL Server Configuration Manager Click, select SQLExpress protocol, on the right "TCP/IP" To see if disabled is displayed, double-click it to enable it:
Step two: Select "MSSQLSERVER protocol" and also enable "TCP/IP"
Step three: Select its child node "client protocol" at SQL Native client configuration to see if the "TCP/IP" protocol on the right is enabled, no, and then enable it:
Fourth step: Double-click the TCP/IP protocol to view the properties panel to see if it listens to the "1433" port
Fifth Step: Finally restart the computer ~ ~ Test Landing ~ ~ ~ ~ ~
Additional:
If you find that you cannot use "local" or "localhost" to log in
Solution :
Open the C:\WINDOWS\SYSTEM32\DRIVERS\ETC path and find
Hosts file;
Then use Notepad to open and see if there is anything like:
Copy Code code as follows:
# localhost name resolution is handled within DNS itself.
# 127.0.0.1 localhost
If not, add it below;
Then restart the computer ~~ok ~ ~