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

Retrieve variable Settings values.

Hi,

I am retrieveing Application settings using
"Properties.Settings.Default.xxxxxxxx" where xxxxxxxx is known at design
time.

How can I retrieve a 'soft' setting, ie: the value I wish to retrieve is
the prefix to a file name. I can get the prefix value from the file, but how
would I lookup the coresponding settings value, as it appears that the
settings are all set at design time. I will need to change the prefix of the
files, and so would like to change the prefix value that is being looked up
in the settings file.

Any ideas please ?

Thanks.
Aug 14 '06 #1
2 1737
I'm not 100% clear from the question, but do you just mean this?

string settingName = "SomeRandomStringSetAtRuntime";
Properties.Settings.Default[settingName]

??

Marc

Aug 15 '06 #2
Thanks, thats sorted it.

Obvious but I didnt click that the Settings are in an array ! (Doh)
string sVal = "TestSetting";

string retval = (string)Properties.Settings.Default[sVal];

I can now retrieve the value I need, thanks a lot !

Jon


"Marc Gravell" <ma**********@gmail.comwrote in message
news:11**********************@h48g2000cwc.googlegr oups.com...
I'm not 100% clear from the question, but do you just mean this?

string settingName = "SomeRandomStringSetAtRuntime";
Properties.Settings.Default[settingName]

??

Marc

Aug 15 '06 #3

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

Similar topics

6
by: Salvani Langosta | last post by:
In an Access 97 database, I use serveral global variables that hold information about the database, for example: gstrFileServer - holds the server root where the database is stored...
10
by: Not Available | last post by:
On the host server: namespace JCart.Common public class JCartConfiguration : IConfigurationSectionHandler private static String dbConnectionString; public static String ConnectionString { get...
1
by: Kenny ODell | last post by:
I am struggling a bit with XML, even as I wade through endless help files and several books. I thought it would be useful to toss my particular needs to the group to see what you think is the best...
4
by: marco.nl | last post by:
it fails to retrieve newly intruduced data by the user. i tried this ... AfxGetApp()->WriteProfileString("Settings", "email", EDIT1); UpdateData(FALSE); and this.....
0
by: tigger | last post by:
Hi there, I'm having problems retrieving data from Access database using Visual basic 2005. My database is called Actual_Database and it has a few tables. One of them is called...
4
chumlyumly
by: chumlyumly | last post by:
Hi - I'm working with PHP5 MySQL Mac OSX I've developed two pages where a user can input his/her info, which goes to a MySQL database. The first page is supposed to pass the newly created...
0
by: tharika_c | last post by:
Hi, We have a simple ASP.NET web application where one of the Session variables, called Session("SSO_ID") gets created and assigned a value (equal to the HTTP_HRID request variable value),...
6
by: dmorand | last post by:
I'm populating some checkboxes from a query result. I'm having a problem retrieving the data to file it to my database. How do I retrieve the checkbox values when the names are variable names? I...
4
by: Michael | last post by:
I am using Web Developer Express 2005. I created a little form to add some content to a database. I keep the formview default mode in the insert mode. The values are being added to the database...
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: 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
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,...
0
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...
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
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.