方法一:
方法二:
string
myconn
=
system.configuration.configurationmanager.connectionstrings[
"
sqlconnectionstring
"
].connectionstring;
方法二:
string
connstring
=
system.web.configuration.webconfigurationmanager.connectionstrings[
"
sqlconnectionstring
"
].tostring();