Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Connection String: Global.asax vs. web.config file

Reply
Thread Tools

Connection String: Global.asax vs. web.config file

 
 
D. Shane Fowlkes
Guest
Posts: n/a
 
      01-12-2004
Upon reading through my ASP.NET book, I've learned how to place the
connection string in both locations in my application. Just due to habit, I
naturally want to place my SQL Server connection string in the asax
file...but are there really advantages to having in one file over the other?

Thanks


 
Reply With Quote
 
 
 
 
Steve C. Orr [MVP, MCSD]
Guest
Posts: n/a
 
      01-12-2004
Your web.config file is generally considered a better place because it's a
simple text file that is easily updated without needing to recompile
anything and changes go into effect immediately.

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
Hire top-notch developers at http://www.able-consulting.com



"D. Shane Fowlkes" <> wrote in message
news:%...
> Upon reading through my ASP.NET book, I've learned how to place the
> connection string in both locations in my application. Just due to habit,

I
> naturally want to place my SQL Server connection string in the asax
> file...but are there really advantages to having in one file over the

other?
>
> Thanks
>
>



 
Reply With Quote
 
 
 
 
Jeremy
Guest
Posts: n/a
 
      01-12-2004
I agree.

I use the web.config file because in our environment I
have to move an application from development to staging
(for testing) and then up to production. So rather than
making the change in the asax file and recompiling every
time before pushing the application up to the next stage I
just open the web.config and make the change.

I guess it's all just preference, whatever you feel most
comfortable in doing, but I vote for web.config

Jeremy

>-----Original Message-----
>Your web.config file is generally considered a better

place because it's a
>simple text file that is easily updated without needing

to recompile
>anything and changes go into effect immediately.
>
>--
>I hope this helps,
>Steve C. Orr, MCSD, MVP
>http://Steve.Orr.net
>Hire top-notch developers at http://www.able-

consulting.com
>
>
>
>"D. Shane Fowlkes" <> wrote

in message
>news:%...
>> Upon reading through my ASP.NET book, I've learned how

to place the
>> connection string in both locations in my application.

Just due to habit,
>I
>> naturally want to place my SQL Server connection string

in the asax
>> file...but are there really advantages to having in one

file over the
>other?
>>
>> Thanks
>>
>>

>
>
>.
>

 
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
No "Wireless Network Connection" available in network connection =?Utf-8?B?am9raW5kYTE=?= Wireless Networking 7 10-16-2012 07:32 AM
ICS works with wired connection, fails with wireless connection Rich Wireless Networking 0 11-16-2005 06:48 PM
Wireless Connection drops / PS2 connection Steve Wireless Networking 1 07-27-2005 01:27 PM
Not seeing Wireless Connection in Network Connection =?Utf-8?B?bW90b21hbm1hdHQ=?= Wireless Networking 4 03-05-2005 04:39 AM
is there standard file format that encapsulates xml+css in one file? (for use without an internet connection) john schultz XML 2 06-05-2004 09:34 PM



Advertisments
 



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 47 48 49 50 51 52 53 54 55 56 57