473,569 Members | 2,991 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem with user control and application/user settings

GAZ
Hello all,

We have a bit of a problem with application settings and user control. In
short, we have developed a user control that should, as it happenes, get a
value stored in application settings of its host application. The app.config
of the host application looks like this:

<appSettings>
<add key="SQLConnect ionString" value="some value" />
</appSettings>

<userSettings >
<Test_Control_L ibrary.My.MySet tings>
<setting name="UserSQL" serializeAs="St ring">
<value>User</value>
</setting>
</Test_Control_Li brary.My.MySett ings>
</userSettings>
Now, our control can read the SQLConnectionSt ring value from <appSettings>
by using:

System.Configur ation.Configura tionSettings.Ap pSettings("SQLC onnectionString ")

However, what we really need to get is the value stored in the UserSQL
setting under <userSettingsan d we haven't got a foggiest how to do it. The
reason behind using user settings is that the UserSQL value can change
during the course of work and hence all controls should reflect that change.

Any help would be greatly appreciated.

BR,

GAZ
Jul 22 '06 #1
1 1740
GAZ
Got the solution:

In my application I added:

Dim config As System.Configur ation.Configura tion =
ConfigurationMa nager.OpenExeCo nfiguration(Con figurationUserL evel.None)
config.AppSetti ngs.Settings.Ad d("SQLConnectio nString", "The-Conn-String")
config.Save(Sys tem.Configurati on.Configuratio nSaveMode.Modif ied)
ConfigurationMa nager.RefreshSe ction("appSetti ngs")

And in my control:

_SQLConnectionS tring =
System.Configur ation.Configura tionSettings.Ap pSettings("SQLC onnectionString ")
Somewhat awkward solution, could've been a bit simpler but there we go.

BR,

GAZ

"GAZ" <ga*@gaz.comwro te in message
news:%2******** **********@TK2M SFTNGP04.phx.gb l...
Hello all,

We have a bit of a problem with application settings and user control. In
short, we have developed a user control that should, as it happenes, get a
value stored in application settings of its host application. The
app.config of the host application looks like this:

<appSettings>
<add key="SQLConnect ionString" value="some value" />
</appSettings>

<userSettings >
<Test_Control_L ibrary.My.MySet tings>
<setting name="UserSQL" serializeAs="St ring">
<value>User</value>
</setting>
</Test_Control_Li brary.My.MySett ings>
</userSettings>
Now, our control can read the SQLConnectionSt ring value from <appSettings>
by using:
System.Configur ation.Configura tionSettings.Ap pSettings("SQLC onnectionString ")

However, what we really need to get is the value stored in the UserSQL
setting under <userSettingsan d we haven't got a foggiest how to do it.
The reason behind using user settings is that the UserSQL value can change
during the course of work and hence all controls should reflect that
change.

Any help would be greatly appreciated.

BR,

GAZ

Jul 24 '06 #2

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

Similar topics

12
8466
by: SJD | last post by:
I've just read Christoph Schittko's article on XmlSerializer: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnxmlnet/html/trblshtxsd.asp . . . and very informative it is too. I, too, am getting nasty FileNotFound exceptions. I've read, and digested the article, and I think I've found a bug -- it's difficult to track,...
4
2180
by: Chris Gatto | last post by:
Hi, I'm having what should be a minor problem but has turned into a 2 day slug fest with ASP.Net. I am simply attempting to authenticate my asp.net application users against users in an AD group set up on our domain. It seems to me I am missing something very simple and obvious, but none of the MSDN articles I have read are indicating...
3
5913
by: Marauderz | last post by:
Hello guys, got a little question regarding the regional language settings . Anyway I got a Windows 2003 Server machine that was installed with the date format "dd/MM/yyyy" and location still locked in US. As we migrated certain apps over to the new machine. we found out something... someone coded a Now.ToString in a database query... and...
3
3050
by: Pitcairnia | last post by:
The basic purpose of the site is for authenticated users to post event listings, which often include photographs. The user is faced with a page where they can insert all of the information about the event in a typical form with textboxes, drop down lists, etc. On this page there are also 4 file upload controls where the user can select 0 to...
2
5692
by: Miguel | last post by:
Hi, I'm developing an application in C# with Windows Forms for my company that is similar to the MSN Messenger. This application uses a webservice for registering users, etc... and as 2 webbrowser controls on it. Besides that i'm using the firewall client for isa server 2004 and it seems that the browsers aren't able to pass thru it... if i...
13
3918
by: Lee Newson | last post by:
Hi, I have just written my first application using VB.NET. The app works fine when i am running it within .NET for debugging purposes, however when i try to run the app from the .exe file that .NET creates i get the following error message: "An unhandled exception of type 'System.IO.FileNotFoundException' occurred in VisioTimeline.exe
0
1531
by: Brano | last post by:
Hi all, I have a asp.net website that has been live for about 2 weeks now and there were no problems with it. I have got a new server that is Win 2003 IIS 6.0 I have moved my application onto the new server and basically copied the settings from the server it worked on perfectly. But now i am getting an Intermittent error it happens...
5
1796
by: Steve Barnett | last post by:
I added some user settings to my app which caused the Settings.settings to be generated etc... and all was well and lovely and the Sun was shining. Then I changed the version number of my assembly (it had been updated, after all) and all of my settings disappeared, which was somewhat less than lovely and the clouds came rolling in. I...
4
911
by: =?Utf-8?B?QW5keSBXZWVkbWFu?= | last post by:
I have two projects in a solution. Project 1 is a user control. In this user control I define an application setting to store a url the user control needs to talk to. Project 2 is our flagship product which has a reference to project 1 and uses the user control defined in project 1 on a form in project 2. When I compile project 1 and...
0
7703
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...
0
7618
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
8138
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...
1
5514
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...
0
5223
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
3657
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2117
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
1228
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
946
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.