Monday, February 20, 2012

My ISP Does Not Allow Me to Remotely Connect to My Hosted SQL Server DB--How Can I Use SQL

All,

My ISP does not allow me to remotely connect to my hosted SQL Server DB--how can I use SQLDataSource and other data bound controls in development?

Here are my specs:

IDE: Visual Web Developer Express 2005

Database: MS SQL Server

ASP Version: ASP.NET 2.0

The SQL Server is hosted centrally at the ISP; basically I have been given the connection string parameters.

My question is this:

Do I use two web.config files (one for when I develop locally and one for when I deploy remotely)? If so, how? Will the SQLDataSource control find the connection string defined in web.config on the remote server? I don't want to have to write all of the database code and it would be a big loss of one of the major benefits of using ASP.NET 2.0 if I do.

Any help will be greatly appreciated,

Leslie

You can develop and then test on the live server, you can set up a similar environment for development and make whatever changes are needed when you upload or you can change providers.

Jeff

|||

Hi, Jeff,

Thank you for the quick response.

I understand what you are suggesting and thought it would work too, but when I copy my (test) .aspx file (that uses a databound control and the SQLDataSource control) to the server and change my connection string to the one corresponding to my hosted instance of the database, I get a runtime error.

Shall I post source code?

Leslie

|||

Post the full error.

Jeff

|||

Jeff,

My connection string had the "provider=sqloledb" key in it which gave an error. I used trace.asd to figure it out. Thank you so much for your help.

Leslie

No comments:

Post a Comment