473,465 Members | 1,976 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Can't get the updated value from configurationsetting.appsetting

Dear All,

I use function configurationsettings.appsetting to retrieve the
connection string value which stored in a file app.config. At the beginning,
it's fine that it can pick up the value according to the key passed into
function. But when I make some change in the value of app.config, it still
pick up the old value to me, not the updated one. I'd tried to rebuild the
project or quit the vb.net and re-start it again. It still pick up the old
value to me. Can anyone tell me what should I do? Please help. Thanks

Best Rdgs
Ellis
Jul 21 '05 #1
2 2701
Make sure that the correct config file is being copied to the folder with
your executable.

"Ellis Yu" <el******@transfield.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Dear All,

I use function configurationsettings.appsetting to retrieve the
connection string value which stored in a file app.config. At the
beginning,
it's fine that it can pick up the value according to the key passed into
function. But when I make some change in the value of app.config, it still
pick up the old value to me, not the updated one. I'd tried to rebuild the
project or quit the vb.net and re-start it again. It still pick up the old
value to me. Can anyone tell me what should I do? Please help. Thanks

Best Rdgs
Ellis

Jul 21 '05 #2
>I use function configurationsettings.appsetting to retrieve the
connection string value which stored in a file app.config. At the beginning,
it's fine that it can pick up the value according to the key passed into
function. But when I make some change in the value of app.config, it still
pick up the old value to me, not the updated one.


Yes, the app settings stuff works by grabbing and interpreting the
..config file ONCE, at startup of the app. It will *NEVER* pick up any
subsequent changes at runtime. The whole "MyApp.exe.config" stuff is
*NOT* intended to be used for settings that need to be updated - it's
designed from ground up to be read-only, and read only once, at app
startup.

If you need more dynamic settings (which can be updated and stored and
changed at runtime), you'll need to look elsewhere - check e.g.
www.codeproject.com for a wealth of "user settings" components that
will store your preferences in text, XML or other files, anywhere on
your disk (the "isolated storage" area would be the preferred location
for safety reasons), or in the registry (discouraged in .NET to do
so).

Marc
================================================== ==============
Marc Scheuner May The Source Be With You!
Bern, Switzerland m.scheuner(at)inova.ch
Jul 21 '05 #3

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

Similar topics

2
by: Julia | last post by:
Hi, My host application loading plugins at runtime How can I dynamically load types from a dll without specify the name of the dll in my application or in a config file can I give a dll an...
4
by: Yuk Cheng | last post by:
<<<start index.htm>>> <html> <head> <script> function perform(action){ } </script> </head>
9
by: james | last post by:
According to the documentation ConfigurationSetting.GetConfig( string ) is used to get user defined config settings. Yet, no matter how I try to add my own sections to the app.config I keep...
1
by: Maziar Aflatoun | last post by:
Hi everyone, I'm tring to read the appSettings from my Web.config file in Visual Studio.Net (Code behind page) and it doesn't recognize ConfigurationSettings.AppSetting? Yet it works in my .aspx...
6
by: Marcos MOS | last post by:
Hi, I've put a appSetting tag into my web.config, but when I try to catch its value to my Image WebControl occurs the follow error: "Server tags cannot contain <% ... %> constructs." on...
1
by: somequestion | last post by:
i work on asp.net 2.0 so i have to change property of web.config file on the web page i mean when i make a board i want to change PageSize in the web.config file. so i use...
2
by: Ellis Yu | last post by:
Dear All, I use function configurationsettings.appsetting to retrieve the connection string value which stored in a file app.config. At the beginning, it's fine that it can pick up the value...
5
by: cdtsly | last post by:
Hi i have a table with all value at 4 i select all lines in a fetch i update one with a value of 7 i update all the row in the fetch with a value 5 the result is that all my row are at 5 and...
2
by: =?Utf-8?B?UGhpbCBKb2huc29u?= | last post by:
Hi, I have right clicked my project in VS2008 and added a DB Connection application setting. How do I access these settings from my code? I know this must be pretty simple, but I cannot see...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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...
0
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...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...

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.