ASP.NET public site connect to internal data source

I have a public facing ASP.NET web forms site. Client want to use an internal SQL Server to access data and in some cases also access data that is beyond their internal network. My question is how do I modify the connection string and connection to allow the SQL connection to connect and access data in their internal network from a ASP.NET web forms site not on their network?
Kelly MartensAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Dirk StraussSenior Full Stack DeveloperCommented:
There wouldn't be too much difference between connecting to a local server (on the internal network) and connecting from an external ASP.NET site to a local SQL database. You would probably need to have the database administrator configure the server to allow remote connections, but in essence the connection string in your web.config file would point to an IP address and Port. It could look something similar to:

<connectionStrings>
  <add name="MyConnectionString" connectionString="Data Source=SERVER-IP:PORT;Database=DBName;User Name=<user>;Password=<pass>" providerName="System.Data.SqlClient" />
</connectionStrings>

Open in new window


This way you can connect to the remote server (it's remote to your ASP.NET application and access the required data.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.