473,804 Members | 2,205 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3066
On May 3, 8:00 am, Mike P <mike.p...@gmai l.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*******@gmai l.comwrote in message
news:u6******** ******@TK2MSFTN GP03.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
4751
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, but once per week, the oracle server is brought down for backup. At that time, I get an error that looks like I have the wrong credentials for the database. For every subsequent attempt to run the hourly process, I am getting a broken pipe error,...
4
4440
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 strings' instead of 'one liners' I check the streams for terminators. I'm having problems with the connection, I've been looking and debugging for 2 weeks now (debugging with an emulator is terribly slow..) but I'm not getting it...
4
2145
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 test=res.GetString("TestString");
1
1120
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 'finding' the strings that should be placed in resource files I'm not looking for programs that 'test' the application and show whether I've missed a string, - I want to produce a list of strings before I create the resource file Thanks in...
14
3511
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, one developer suggested that it's a security flaw; therefore connection strings should be kept somewhere else or encrypted. My argument is that web.config file is protected by IIS and Windows security which is the case. And another argument is that...
4
1759
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 this adds a huge performance boost in the application but I don't understand why. Is there something to this? Bill
2
1841
by: =?Utf-8?B?U2JhdGNodQ==?= | last post by:
How will i read connection strings in all web.config files in one particualr machine?
6
5741
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 to write strings in ".rc" file and retrieve it programmatically? Do you guys have any idea on this? Is there any good article on this?
9
2683
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 live. I know I can do something similar with globalStorage in FF, window.name & userData on IE, but those storages only hold strings.
0
9715
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9595
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10352
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
7642
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6867
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5673
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4313
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3835
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3002
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.