473,545 Members | 1,893 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Can't get the updated value from configurationse tting.appsettin g

Dear All,

I use function configurationse ttings.appsetti ng 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 2715
Make sure that the correct config file is being copied to the folder with
your executable.

"Ellis Yu" <el******@trans field.com> wrote in message
news:%2******** ********@TK2MSF TNGP11.phx.gbl. ..
Dear All,

I use function configurationse ttings.appsetti ng 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 configurationse ttings.appsetti ng 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.conf ig" 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)i nova.ch
Jul 21 '05 #3

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

Similar topics

2
1549
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 alias? assuming i have two implemnatations of a messaging service(only one should be installed)
4
5754
by: Yuk Cheng | last post by:
<<<start index.htm>>> <html> <head> <script> function perform(action){ } </script> </head>
9
5047
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 getting errors stating an invalid config file section found. So, can someone elighten me as to how this is to be used ?? thanks JIM
1
1311
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 page. Any idea? Thank you Maz
6
47624
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 myPage.aspx (Notice the ImageUrl tag): <asp:Image id="Image1" runat="server" ImageUrl=<%=System.Configuration.ConfigurationSettings.AppSettings%> />
1
1906
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 ConfigurationManage.AppSettings when i getting property value. but i also want to set this property.
2
352
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 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...
5
1832
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 the only line which should be at 7 is at 5 too. i see that the problem is at the first mysql_db_query, and i don t know
2
1832
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 how to do it. -- Regards,
0
7416
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...
0
7676
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7776
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6001
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
4965
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...
0
3456
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1905
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
1
1032
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
729
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...

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.