.net - c# - How to get the value of the defaultDatabase? -
my web.config has line
<dataconfiguration defaultdatabase="valueiwant"/>
that lists name of default database connection string use. how can name within c#?
sudo code:
string info = getdefaultdatabase(); console.writeline(info);
would print valueiwant
.
thanks
if config value is custom configuration section, need section via configurationmanager.getsection():
mycustomconfigsection config = (myconstomconfigsection) configurationmanager.getsection( "mycustomconfigsectionname" ) ;
and how desired value referenced entirely dependent on custom config section widget.
Comments
Post a Comment