Click here to Skip to main content
15,884,298 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
i need help please ,
i can't connect my sql server database which located on another pc in same network
i read more topics in this issue but nothing success with me :(
server type : database engine .
servername : 192.168.1.2\SQLEXPRESS OR mypcname\SQLEXPRESS
Authentication : SQL SERVER Authentication
username : sa
password : *********

error is :

a network related or instance specific error occurred while establishing a connection to sql server ,verify the instance name is correct and that sql server is configured to allow remote connections

please read below steps that i do :
1- database worked fine on the server and i connect it using sa user with no problem (from server machine )

2- i enable remote connection and marked on : enable local and remote connection which in service area configuration

3- in the server machine i turn the firewall off totally .

4- i make sure that both TCP and shared memory are enabled in sqlexpress protocol
is there any step i miss ??
Posted
Updated 27-Mar-14 3:31am
v2
Comments
[no name] 27-Mar-14 9:43am    
Is your server computer actually plugged into the network? Can you ping the server from the other computer?
Hercal 27-Mar-14 9:56am    
yes sir , when i ping 192.168.1.2 , it gives reply

1 solution

If you are using ADO.NET in your app.config (or web.config) you connection string should be something like the next one:
HTML
<setting name="ConnectionStrings" serializeas="String">
        <value>server=192.168.1.2;database=YourDBName;user=sa;password=xxxxx;</value>        
 </setting>


More info about SQL Server connection strings are here![^]

Then by using MS SQL Server Management Studio, in the "Server Properties" -> Connections page you have to check "Allow remote connection to this server" option, and should work!
 
Share this answer
 
v2
Comments
Hercal 27-Mar-14 9:58am    
thanks you but now i don't want to use ado.net , i just only need to open my database using SqlServer Management Studio from another pc as i said , .... any idea ?
Raul Iloc 27-Mar-14 13:31pm    
You put as tag C# and ASP.NET and this confuse me.
Hercal 27-Mar-14 17:28pm    
sorry sir for making you confused but most of C# and ASP.net Developers should be aware with this issue

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900