Click here to Skip to main content
15,898,373 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
My system has been connected by the wireless network.I want access database from another system, how to write the connection string.
Please Help me ...


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: TCP Provider, error: 0 - A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.)


I am facing this error...


XML
<connectionStrings >
   <add name="myConnectionString" connectionString="Server=192.168.11.4,1433;Database=Employee;User ID=sa;Password=12345;Trusted_Connection=False;" providerName="System.Data.SqlClient"/>
 </connectionStrings>
Posted
Updated 3-Mar-14 0:02am
v3
Comments
Vedat Ozan Oner 3-Mar-14 2:18am    
search google with 'I want access database from another system, how to write the connection string.'
Pranav-BiTwiser 3-Mar-14 6:09am    
dont put the port number...
Gokul Athithan 3-Mar-14 6:28am    
I am getting this error
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: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

use IP Address



in Sqlserver
 
Share this answer
 
Comments
Gokul Athithan 3-Mar-14 5:50am    
I have used but not connecting
How did you installed your SQL Server database? Check whether you have used Mixed Mode Authentication while installation. In mixed mode authentication use 'sa' as User Name and give your desired password.

Connection string for this would be

XML
<configuration>
  <connectionStrings>
    <add name="conn" connectionString="Server=myServerName\SQLEXPRESS;Database=myDataBase;User Id=myUsername; Password=myPassword;" providerName="System.Data.SqlClient"/>
  </connectionStrings>
</configuration>


Also check for any firewall setting present on server machine which may prevent connection to your database.
 
Share this answer
 
SQL Server connection strings - ConnectionStrings.com[^]

If you face any issue on connection side, check this
Basically, when you failed to connect to your SQL Server, the issue could be:
1) Network issue,
2) SQL Server configuration issue.
3) Firewall issue,
4) Client driver issue,
5) Application configuration issue.
6) Authentication and logon issue.
Check these
Steps to troubleshoot SQL connectivity issues[^]
SQL Server 2005 Connectivity Issue Troubleshoot - Part I[^]
Troubleshoot Connectivity Issue in SQL Server 2005 - Part II[^]
Troubleshoot Connectivity Issue in SQL Server 2005 - Part III[^]
 
Share this answer
 
When your SQL Server is running in one Local Area Netwrok (with private IP addresses), and you want to connect to it from another computer outside that network, there are two major options:
- Use "port forwarding" for the SQL Server port on the "modem" of the LAN (note: security issues!)
- Set up a virtual private network (VPN) such that the external computer looks like being inside your LAN (recommended).
 
Share this answer
 
1. connectionString="Server=192.168.11.4,1433; there must be a : between IP address and port, i.e. connectionString="Server=192.168.11.4:1433;
2. Make sure that the SQL Server is configured to allow connections from other computers.
3. Make sure that TCP/IP protocol for connections is enabled.
 
Share this answer
 
Cool dude!

The problem was server name

<connectionstrings>
<add name="myConnectionString" connectionstring="Server=192.168.11.4:1433;Database=Employee;User ID=sa;Password=12345;Trusted_Connection=False;" providername="System.Data.SqlClient">
 
Share this answer
 

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