Reputation: 11
I have hosted a web application(Application is in Asp.Net with C# language and Sql server database). Now i want to store data in my local database from my hosted web application.How will be the database connection string...any addition changes in Sql Server..?Please explain..Any reply will be appreciated..
DeEP
Upvotes: 1
Views: 2088
Reputation: 6409
Sounds like you need to speak to your network administrator - I'd guess that your firewall will probably be set up stop any attempt to access it from outside of your network.
If your hosting company allow it, you maybe able to set up a VPN between the web server and your local database but this would be a lot of hassle.
Upvotes: 0
Reputation: 44605
from .NET 2 upwards the connection string can be stored in a specific node of the web.config
file and not in appSettings
as it was done before.
I am not sure about your question because if you try to access a database server located outside the network where you have deployed your ASP.NET application (so the hosting provider's internal network), it won't probably work, even in case your SQL Server is publicly available and open for connections from outside (which is bad, really, really bad...), it would also depend on the hosting company network settings.
How did you connect to the SQL Server during development and for debugging within the development machine?
There are info on how to connect to a SQL Server with a connection string in the web.config here: Using connection strings from web.config in ASP.NET v2.0 but not sure this solves your issue.
Upvotes: 1