473,386 Members | 1,924 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Connection strings and resource files

I've always put my connection strings in the web.config, but I've just
recently seen an example of a connection string in a resource file.
What are the advantages of doing this, and could you do it for other
stuff that you would normally put in your web.config?

*** Sent via Developersdex http://www.developersdex.com ***
May 3 '07 #1
2 3036
On May 3, 8:00 am, Mike P <mike.p...@gmail.comwrote:
I've always put my connection strings in the web.config, but I've just
recently seen an example of a connection string in a resource file.
What are the advantages of doing this, and could you do it for other
stuff that you would normally put in your web.config?
There's not advantage, infact its a disadvantage. The connection
string is one of those things you'd like to be able to change without
recompiling the code. Put your string in a resource file, and you've
lost this ability. You also lose the ability to use connection string
encyption (if you're on .net 2).

Resource files are most useful for static strings (which an end user
may see), so that you don't have to hardcode them into code,
especially if you are going to localize your application. If you're
localizing, you simply create another resx file for the culture you're
targeting and translate all the strings there and you're done.

May 3 '07 #2
"Mike P" <mi*******@gmail.comwrote in message
news:u6**************@TK2MSFTNGP03.phx.gbl...
I've always put my connection strings in the web.config,
Me too...
but I've just recently seen an example of a connection string in a
resource
file. What are the advantages of doing this,
None that spring readily to mind...

and could you do it for other stuff that you would normally put in your
web.config?
Sure - why not...?
--
http://www.markrae.net

May 3 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: JWM | last post by:
I am trying to implement Oracle connection pooling for the following code, which was written by someone else. Here is my main question -- this java file creates code that is executed every hour,...
4
by: Mike Dole | last post by:
I'm working on a client - server application based on the 'How to Sockets Server and How to Sockets Client' code from the Visual Basic ..NET Resource Kit. Since I want to be able to send 'big...
4
by: Phil Da Lick! | last post by:
Hello, Got strings.resx included in my assmebly as the default language neutral collection. ResourceManager res=new ResourceManager("strings", Assembly.GetExecutingAssembly()); string...
1
by: Graham | last post by:
I have to localize a very large web application and therefore have to provide resource strings for all hard-coded strings in the application that will be visible to users Is there a technique for...
14
by: WebMatrix | last post by:
Hello, I have developed a web application that connects to 2 different database servers. The connection strings with db username + password are stored in web.config file. After a code review,...
4
by: dwyer.bill | last post by:
My boss insists that whenever we use a string we place it in a resource file every single time. This goes for error string that are displayed through a message box, constants, ect. He claims that...
2
by: =?Utf-8?B?U2JhdGNodQ==?= | last post by:
How will i read connection strings in all web.config files in one particualr machine?
6
by: Sabiyur | last post by:
Hi All, The application I am doing requires hundreds of strings to be stored & retrieve those randomly. I think I can use microsoft resource ".rc" file to store the strings. I am not sure, how...
9
by: mel | last post by:
Hi all, I need a persistent TCP connection with my web server over page reloads. This means that, even if the user goes to a different page (in my domain), I want to keep a TCP connection...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.