Click here to Skip to main content
15,893,487 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello all,
I have a problem accessing my remote server datatbase,any help please..
My App.config file contains

XML
<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <appSettings>
          <add key="ConnectionString" value="Data Source=192.168.50.51\ACCTSERVER;Initial catalog=BOM;Integrated security=True;Uid=UserName;Pwd=Password;" />
  </appSettings>
</configuration>
Posted
Comments
Madhu Nair 11-Oct-13 4:18am    
What is the error message?

which error you get..??

As I knew & I did, For remote server in a LAN first you have to setup sqlserver to remote acesseable , and also add access permision in firewall.

One more thing I want to add here you use "Data Source=192.168.50.51\ACCTSERVER"
But here only IP address is required.
 
Share this answer
 
v4
Comments
Ravndra22 11-Oct-13 4:27am    
A error message si like
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)


and I Already tried for Data source=192.168.50.51 but same error...
Hemant Singh Rautela 11-Oct-13 4:46am    
ya, As I told REMOTE SERVER SETTINGS IN SQL SERVER (allow remote access in sql server)...
:-)
Once try by replacing IP with Server Name.

If still problem exist,
then make sure TCP/IP is enabled and Allow Remote Connection are allowed.

To Enable TCP/IP go trough following steps:
1. Open Sql Server Configuration Manager
2. In left panel click SQL Sever Network Configuration
3. Then further Click on Protocols for MSSQLSERVER Node.
4. On the right panel you will find TCP/IP, Right Click it and just Enable.

To Allow Remote Connection on SQL SERVER go trough following steps:
1. Open MS SQL SERVER connect with Windows or SQL Authentication.
2. Right click on Server and go to properties.
3. In Left Pane click on Connection Node.
4. On Right Pane, you will find CheckBox saying Allow Remote Connection to this Server, Check this box & Click Ok.
5. Again right click on Server and Restart SQL Server.
 
Share this answer
 
Comments
Ravndra22 11-Oct-13 4:40am    
Yeah.... TCP/IP was disabled.thats why I am getting that error...

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