By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,850 Members | 970 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,850 IT Pros & Developers. It's quick & easy.

How can I change a ConnectionString depending on the dev or prod environment ?

P: n/a
Hello,

It is about a VB2008 intranet application. It uses a SQL Server database.
The ConnectionString is defined in the
connectionStrings section of the web.config file. This application uses
ObjectDataSource objects, defined in design mode.

I would like to use a different database depending on the execution
environment (development or production).

I can test the environment by retrieving the IIS server name. I could of
course change the web.config file by hand, but every time I will publish
from dev to prod I should do the change again.Of course, a day or another
there will be a forgetting or a mistake.

Can anybody propose an automatic solution?

Thank you in advance,
Gilbert

Jun 27 '08 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Just use web deployment projects, you can create 1 project for each
environment you'll be deploying the web application to. Here's the link for
the RTW (Release to Web) version for VS2008.

http://www.microsoft.com/downloads/d...displaylang=en

If you're using a build server, don't forget to install it on there as well
or you'll get an error when it tries to build.

"Gilbert Tordeur" <gi*************@jci.comwrote in message
news:O3**************@TK2MSFTNGP03.phx.gbl...
Hello,

It is about a VB2008 intranet application. It uses a SQL Server database.
The ConnectionString is defined in the
connectionStrings section of the web.config file. This application uses
ObjectDataSource objects, defined in design mode.

I would like to use a different database depending on the execution
environment (development or production).

I can test the environment by retrieving the IIS server name. I could of
course change the web.config file by hand, but every time I will publish
from dev to prod I should do the change again.Of course, a day or another
there will be a forgetting or a mistake.

Can anybody propose an automatic solution?

Thank you in advance,
Gilbert
Jun 27 '08 #2

P: n/a
Thank you Jeff for your suggestion. I didn't even know the existence of this
tool.
have a good day,
Gilbert

"Jeff Winn" <jw***@nospam.coma écrit dans le message de news:
8A**********************************@microsoft.com...
Just use web deployment projects, you can create 1 project for each
environment you'll be deploying the web application to. Here's the link
for the RTW (Release to Web) version for VS2008.

http://www.microsoft.com/downloads/d...displaylang=en

If you're using a build server, don't forget to install it on there as
well or you'll get an error when it tries to build.

"Gilbert Tordeur" <gi*************@jci.comwrote in message
news:O3**************@TK2MSFTNGP03.phx.gbl...
>Hello,

It is about a VB2008 intranet application. It uses a SQL Server
database. The ConnectionString is defined in the
connectionStrings section of the web.config file. This application uses
ObjectDataSource objects, defined in design mode.

I would like to use a different database depending on the execution
environment (development or production).

I can test the environment by retrieving the IIS server name. I could of
course change the web.config file by hand, but every time I will publish
from dev to prod I should do the change again.Of course, a day or another
there will be a forgetting or a mistake.

Can anybody propose an automatic solution?

Thank you in advance,
Gilbert

Jun 27 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.