Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net (http://www.velocityreviews.com/forums/f29-asp-net.html)
-   -   I need to have another connection string then the one in machine.config (http://www.velocityreviews.com/forums/t710711-i-need-to-have-another-connection-string-then-the-one-in-machine-config.html)

Tony Johansson 01-04-2010 08:17 PM

I need to have another connection string then the one in machine.config
 
Hello!

Suppose I need to have a different connectionstring that the one that exist
in machine.config.

What is the best practice to do this ?
Two alternative.
1. Change in machine.config not so good I suppose.
2. Create a web.config where you made your modifications.

I would guess that alternative 2 is the best one.
One more question. Should the machine.config file never be changed ?

//Tony



Alexey Smirnov 01-04-2010 09:19 PM

Re: I need to have another connection string then the one inmachine.config
 
On Jan 4, 9:17*pm, "Tony Johansson" <johansson.anders...@telia.com>
wrote:
> Hello!
>
> Suppose I need to have a different connectionstring that the one that exist
> in machine.config.
>
> What is the best practice to do this ?
> Two alternative.
> 1. Change in machine.config not so good I suppose.
> 2. Create a web.config where you made your modifications.
>
> I would guess that alternative 2 is the best one.
> One more question. Should the machine.config file never be changed ?
>
> //Tony


The web.config file is the main configuration file for an ASP.NET web
application. Use it to store your connectionstring if this is related
to your single application only. The machine.config is for settings
that apply to an entire computer. It's located in a system directory
and normally cannot be changed e.g. on a shared hosting. (On another
hand because of this, machine.config could be a good idea to secure
settings).

Note, web.config has special connectionStrings Element, dedicated for
this purpose.

Read more

connectionStrings Element
http://msdn.microsoft.com/en-us/library/bf7sd233.aspx

How to: Read Connection Strings from the Web.config File
http://msdn.microsoft.com/en-us/library/ms178411.aspx


All times are GMT. The time now is 04:32 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.