473,403 Members | 2,293 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,403 software developers and data experts.

Dynamic modify App.config

I my login form, I want to let the user choose which database (there are
A,B,C three databases )
I know I can use App.config to change the SQL server (database name).
However, I don't know how to do in my form ??
Please give some adivce.
Nov 21 '05 #1
4 5925
"Agnes" <ag***@dynamictech.com.hk> schrieb:
I my login form, I want to let the user choose which database (there are
A,B,C three databases )
I know I can use App.config to change the SQL server (database name).
However, I don't know how to do in my form ??


Typically, an application doesn't write to its config file. You'll find
some articles on this topic here:

Storing and loading user preferences
<URL:http://dotnet.mvps.org/dotnet/faqs/?id=userpreferences&lang=en>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #2
Hi:

I've the same problem, if i modify the App.config manually it will
reset back to original each time the application run, if i exclude the
App.config in my solution, the app.config will deleted each time the
application run.

What am i doing wrong ?

Thanks
JCVoon
Nov 21 '05 #3
And if you are lucky enough to run VS2005 you can use the application
settings designer and/pr the Client Config API to load/save settings.

http://msdn2.microsoft.com/library/k4s6c3a0.aspx
http://msdn2.microsoft.com/library/c9db58th.aspx

- Stenis

"Herfried K. Wagner [MVP]" wrote:
"Agnes" <ag***@dynamictech.com.hk> schrieb:
I my login form, I want to let the user choose which database (there are
A,B,C three databases )
I know I can use App.config to change the SQL server (database name).
However, I don't know how to do in my form ??


Typically, an application doesn't write to its config file. You'll find
some articles on this topic here:

Storing and loading user preferences
<URL:http://dotnet.mvps.org/dotnet/faqs/?id=userpreferences&lang=en>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #4
And if you are lucky enough to run VS2005 you can use the application
settings designer and/pr the Client Config API to load/save settings.

http://msdn2.microsoft.com/library/k4s6c3a0.aspx
http://msdn2.microsoft.com/library/c9db58th.aspx

- Stenis

"Herfried K. Wagner [MVP]" wrote:
"Agnes" <ag***@dynamictech.com.hk> schrieb:
I my login form, I want to let the user choose which database (there are
A,B,C three databases )
I know I can use App.config to change the SQL server (database name).
However, I don't know how to do in my form ??


Typically, an application doesn't write to its config file. You'll find
some articles on this topic here:

Storing and loading user preferences
<URL:http://dotnet.mvps.org/dotnet/faqs/?id=userpreferences&lang=en>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #5

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

Similar topics

19
by: Nancy | last post by:
Hi, When I start my PC(winXP Pro), it always says: Unknown(): Unable toload dynamic library './php_msql.dll' - The specified module could not be found. Then my Apache servre starts, load php...
2
by: listerofsmeg | last post by:
Newbie here. I want to use a .config file with my simple console app, but no matter what I do I cannot get the "dynamic" rollout in my properties window. In the end I gave up and coded the...
1
by: Matt | last post by:
Hi, I was wondering if anyone can tell me why dynamically updating the web.config file causes ASP.NET worker process to recycle and detroy all session states including variables. Is this a known...
2
by: Maziar Aflatoun | last post by:
Hi, Is there a way to connect to a Web Service dynamically at runtime (Web Reference URL)? I have always used Visual Studio to create a Web Reference and then used it in my code. However, that...
2
by: gregory_may | last post by:
I am using remoting via TCPChannels. Sometimes, I get this message: "Server encountered an internal error. For more information, turn on customErrors in the server's .config file." I don't...
7
by: Mike Livenspargar | last post by:
We have an application converted from v1.1 Framework to v2.0. The executable references a class library which in turn has a web reference. The web reference 'URL Behavior' is set to dynamic. We...
2
by: Sin Jeong-hun | last post by:
I've read the "How to: Create Application Settings" article (http:// msdn2.microsoft.com/en-us/library/ms171565.aspx) on the MSDN. It looked fine. But this code is only good when all the settings...
2
by: muriwai | last post by:
Hi, I am writing a web custom control that displays a dynamically generated image. Apparently I need to register an HTTP handler in web.config. Is there any way to register the handler...
3
by: Jeff | last post by:
I have a solution with two projects. Project A is the startup project, while Project B serves as the project with the data logic. At run time, the first thing I need to do is write to Project...
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: 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
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
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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...

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.