.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

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

sql server - python to mssql encoding problem -

windows - Python Service Installation - "Could not find PythonClass entry" -