Hi,
Well for a simple value, you are best placing that <dataConfiguration />
into the <appSettings />
section as a key-value pair:
<appSettings>
<add key="defaultDatabase" value="foo" />
</appSettings>
If you want to have a custom configuration section, then you need to inherit various classes to conform to the Configuration API.
Here are some tutorials:
http://msdn.microsoft.com/en-us/library/2tw134k3.aspx http://www.codeproject.com/KB/cs/CustomConfigurationSectio.aspx
And here is a link to a Visual Studio configuration section designer tool:
Alternatively, but not advised, you could just read it in as an XML document and parse the value out.
Personally, I'd go for the app settings route.
Adam
2010-07-08 15:08:24