Samudra Lakmal
Samudra Lakmal

Reputation: 61

Windows Application connect using Public IP to SQL Server Database

I have develop Software which is successfully run with Local SQL Server. But my client need it access over the internet.

How i make connect application with database using public ip.

I have try with following connection string. but still i can not log. connectionString="Data Source=XXX.XXX.XXX.X\XXX,7000;Network Library=DBMSSOCN;Initial Catalog=DB;User ID=sa;Password=xxx"

Is there any SQL Server configuration, Router Configuration etc.

Upvotes: 0

Views: 1668

Answers (2)

Ajay
Ajay

Reputation: 6590

First make sure your are able to connect to remote sql from your local sql server.

To connect to remote sql try this

You have to open port for it. After opening port your server name looks like follow.

server name : IP\SqlExpress, 5012

Where 5012 is random port.

Refer this to open port for sql on remote http://blogs.msdn.com/b/walzenbach/archive/2010/04/14/how-to-enable-remote-connections-in-sql-server-2008.aspx

Upvotes: 0

CodeCaster
CodeCaster

Reputation: 151730

You don't expose a database over the internet, it's highly insecure.

Create a webservice that talks to the database, and let your application talk to the webservice.

If you really don't care about security or your client's data (and I'm sure they won't like that), you can. You just need to forward the proper ports in your router.

Upvotes: 2

Related Questions