Click here to Skip to main content
15,921,062 members
Please Sign up or sign in to vote.
0.00/5 (No votes)

I am a software developer in .Net C# 2010 RC & SQL Server 2005.

Currently developing a Windows Application Software in which the database is located in Web Server.

Software has to be implemented in stores and office, where as office is connected via LAN -> proxy server and stores are connected via Direct connection.

Myself connecting to the server via SQLClient in which I use IP Address of the server in the connection string.

When implemented in stores(direct connection) it works fine.

But when tried to connect the software to database in office(via Proxy), it generates 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)"

Please help me to sort out this issue.

Moreover this is my first windows application, I am basically Web developer, I am novice in network related system programming.

I had referred multiple websites, there are some programs, which have bugs or unable to implement.


Kuthubus Saman


thanks for your reply.

But SQL Server is allowing remote connections viz., when connecting from a installation location to remote server via Direct DSL or dial up connection, it executes finely.

Problem or Error occurs when trying to retrieve data from SQL Server through Proxy connection only.
Updated 16-Mar-10 9:33am

Error looks like a Surface Area Configuration issue.
Remote connections are currently disabled on the database server. Enable it.

1. Open this: Start->All Programs->MS SQL Server 2005-> Configuration Tools -> SQL Server Surface Area Configuration
2. Choose Surface Area configuration for Services and Connections
3. Select MSSQLServer->Database Engines->Remote Connections
4. Now select radio button: Local and Remote Connections
5. Also select using both TCP/IP and named pipes
6. Select Ok button. You can restart the SQL Service if needed.
Share this answer
hello Kuthubus Saman, i didnt know how to contact you via email or anything so i replied just to talk to you, i am also making an application which needs to store information onto a server, its a voting system but not in ASP or anything, its a desktop application, can you please help me make this connection, like using internet and storing the votes from one computer onto another computer, i will be sooooooo grateful you cannot even begin to imagine. Thank You in advance please do reply
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