0

I am currently trying to connect to a database made in MS SQL Server and My program works on my system but when i want to access it through other computers in the same network but i can not. How could i edit my connection string? Which settings i should do on SQL server? Should i install SQL server management studio on other computers in the network? Below is my code and an explanation of what is going wrong. connection string and Error enter image description here

Sedighe Rahimi
  • 37
  • 2
  • 13
  • 2
    If you paste the error message into the search box, you'll find hundreds of answers to that. I think the most useful could be this http://stackoverflow.com/questions/18060667/why-am-i-getting-cannot-connect-to-server-a-network-related-or-instance-speci – René Vogt Mar 30 '16 at 11:08
  • i tried many solutions that they said...but they did not work.i am fraustrated – Sedighe Rahimi Mar 30 '16 at 13:21

2 Answers2

0
  1. Press Win+R to open Run command
  2. Type services.msc and click OK
  3. Check that SQL Server(Instance Name) must be in Running state.

Another thing you can try is

  1. Open SQL Server Management Studio.
  2. Right click on Server in Object Explorer and select Properties
  3. Go to Connections tab and Allow remote connections to this server checkbox must be checked
M.S.
  • 4,283
  • 1
  • 19
  • 42
0

Probably you have not configured Firewall on your main desktop(consider as server), So Configure the Windows Firewall to Allow SQL Server Access. open port 1433 in windows firewall. Also do the following steps in Server system:

  • Make sure tcp/ip is enabled in Sql Server Network Configuration
  • Set port :1433
  • Restart sql server
  • Configure the Windows Firewall to Allow SQL Server Access like mentioned

EDIT: See how to Configure the Windows Firewall to Allow SQL Server Access.

Salah Akbari
  • 39,330
  • 10
  • 79
  • 109