Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > .NET General

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

Reply
 
Old 05-26-2008   #1 (permalink)
Gilbert Tordeur


 
 

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

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




My System SpecsSystem Spec
Old 05-26-2008   #2 (permalink)
Jeff Winn


 
 

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

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" <gilbert.tordeur@xxxxxx> wrote in message
news:O3SArg0vIHA.4772@xxxxxx
Quote:

> 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
>
>
>
My System SpecsSystem Spec
Old 05-28-2008   #3 (permalink)
Gilbert Tordeur


 
 

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

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

"Jeff Winn" <jwinn@xxxxxx> a écrit dans le message de news:
8AFE70DC-9E60-4BF7-981B-6F9260BEE97C@xxxxxx...
Quote:

> 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" <gilbert.tordeur@xxxxxx> wrote in message
> news:O3SArg0vIHA.4772@xxxxxx
Quote:

>> 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
>>
>>
>>
>

My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Exception: The ConnectionString property has not been initialized .NET General
renaming files, depending on their dates ... PowerShell
2 separate addresses-can i select, depending on arena? Vista mail
64vs32, prod key, installs, sysdisc Vista General


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46