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

I am having an application in C#.net with Sql server 2008.
I can access the database through LAN using IP address with following connection string

ConnStr = "Data Source=IP Address,TCP port; Network Library=DBMSSOCN; Initial Catalog=DB; User ID=Sa; Password=pass";


Now I want to access the same database through WAN.
I did all setting using
http://msdn.microsoft.com/en-us/library/ms345343(SQL.105).aspx
and using the same above connection string it given me error as

“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 above problem.
Posted

1 solution

I hope you have undergone Connecting to SQL Server over the Internet
in MSDN.

I have tried the same long back and telling it is very difficult to achieve if you dont have your own server. You need to get rid of network, firewall and SQL server. Also you need to get in touvh with your ISP for port opening. Also make sure that your are fetch your public IP Address. It took almost a week to make thi shappen.
 
Share this answer
 
Comments
sheetal.gawde 3-Jul-12 0:00am    
Thanks a lot for your answer. can you please give me detailed description to achieve the above things or any useful link.

Thanks in advanced

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