<add name="COON" connectionString="user id=ss;data source=www;password=123;"/>
web.config中这样写:
<appSettings>
<add key=ORACLEConnectionString value=Provider=OraOLEDB.Oracle.1;
Persist Security Info=False;Password=blah;User ID=greg;Data Source=sph; />
<appSettings>
而在你的应用程序中你只要这样写,就可以了,如下:
string conn = ConfigurationSettings.AppSettings[ORACLEConnectionString];
OleDbConnection myConnection = new OleDbConnection(conn);
引自:http://www.diybl.com/course/4_webprogram/asp.net/asp_netshl/200725/9078.html