Click here to Skip to main content
15,892,005 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more: , +
I am developing a project for School and i have installed SQL server on a computer.It runs perfect on when both system are on same network.
Now i want to access SQL database from home.When these two machines are not on same network.

What I have tried:

I have tried using IP Address but cant get solution.
Posted
Updated 9-Jan-17 21:28pm

The server has to be configured to allow it. You have to contact the DBA that owns the server, and after it's properly configured, he can provide the appropriate connection string. However, any DBA worth his salt won't do as you ask, because it's more secure and auditable to have an outward facing web service that provides controlled access to the database server.
 
Share this answer
 
Comments
Member 12882662 10-Jan-17 3:11am    
I have permission to configure Server.
Please can you tell me how to configure ?? Security is not issue...
Few things you need to ensure:
- Configure the SQL Server to listen to TCP/IP traffic
- Ensure that the firewalls are not blocking the traffic (Windows or other)
- Ensure that a secure communication is used, in other words VPN or similar. Otherwise the server easily becomes vulnerable to outside attacks.
- Ensure that you use complex enough passwords if using SQL Server authentication

To configure SQL Server, see Configure a Server to Listen on a Specific TCP Port (SQL Server Configuration Manager)[^]

To configure Windows firewall see Configure a Windows Firewall for Database Engine Access[^]
 
Share this answer
 
Comments
Member 12882662 10-Jan-17 3:59am    
i have configured all tha but still can not connect to database.
can you tell me which IP has to use in connection string???And all details
Wendelius 10-Jan-17 4:18am    
In the connection string you need to specify the IP address along with the port. See Connect via an IP address - SqlConnection - ConnectionStrings.com[^]
Member 12882662 10-Jan-17 4:27am    
it gives error: The remote computer refused the network??
Wendelius 10-Jan-17 4:32am    
Sounds like the firewall is blocking the traffic. Ensure that proper ports are open on both ends
Member 12882662 10-Jan-17 4:39am    
both ends means?? on both PC?

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