Hi,
The more subtle decision is probably whether to put these in a static or non-static class? In general I go for static because with something like this:
static class AppSettings
{
public static string ConnString;
static AppSettings()
{
ConnString = new SomeLongRunningProcess().GetConnString();
}
}
the long running bit is guaranteed not to be called unless the ConnString value is actually required elsewhere in code. If it were a non-static class the static constructor would fire un-neccessarily the first time an instance of the class was created....
Best,
Viv
>Sorry to be late to the conversation, but I just wanted to mention that the key to making all this work is the fact that you need to use static properties and/or methods.
>
>~~Bonnie
>
>
>
>>Viv
>>
>>I think I have this working now, thanks to your patience and Cetin's.
>>
>>I used a variation on what both of you suggested, as it fit into what I've already done in the app.
>>
>>While at it, this newbie discovered how to use App.config, and it's pretty slick. I'll have dozen of uses for it.