Click here to Skip to main content
16,018,938 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
Hi,
My client is using my SQL Sever application, sever installed on one of his local computers, dbs are being accessed using
connectionString="Data Source=Office1-MAIN-PC\EziBilling;Initial Catalog=dbBilling;User ID=sa"



By now everything is fine, now he demands to access the databases attached to local server, through internet too.
I am planning to create a client application that could connect to the server instance over internet. BUT I do not know what connection string I should use.


Also, how can I get the IP address of the server (do not have static IP)?

Thanks
Posted

1 solution

Hi,

Configure Server instance via SQL Server Configuration Manager to allow TCP/IP Protocols.
SQL Server Network Configuration > Protocol for [InstanceName] > Enable

You could use a Dynamic DNS Service to resolve the IP of the server.

Ensure you open up port 1433 on your Server firewall to allow incoming connections.

Connection string to be used:
C#
connectionString=@"Data Source=\\ServerIPAddress\EziBilling;Initial Catalog=dbBilling;User ID=sa; Password=SomethingVerySecure"


Notes: Please ensure your sa account password is very secure, if you open up SQL server to the internet.

Hope this helps...
 
Share this answer
 
v3

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