Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > I need to have another connection string then the one in machine.config

Reply
Thread Tools

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

 
 
Tony Johansson
Guest
Posts: n/a
 
      01-04-2010
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


 
Reply With Quote
 
 
 
 
Alexey Smirnov
Guest
Posts: n/a
 
      01-04-2010
On Jan 4, 9:17*pm, "Tony Johansson" <(E-Mail Removed)>
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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
C/C++ compilers have one stack for local variables and return addresses and then another stack for array allocations on the stack. Casey Hawthorne C Programming 3 11-01-2009 08:23 PM
When I open laptop lid i have display then it goes away then comes back Ed Computer Support 1 03-02-2006 07:26 PM
How does one play a .wav file and then another and then another...? ted.j.conway@gmail.com Javascript 4 01-17-2006 03:28 AM
Help. SessionID is x then y then x then y BodiKlamph@gmail.com ASP General 0 09-03-2005 03:02 PM
Samsung SCD6040 - Anyone have one, used one, or have reviews on one? g wills Digital Photography 0 09-08-2004 08:06 PM



Advertisments