项“ConnectionString”已添加。问题请教!
在WEB.CONFIG中内容如下
<configuration>
<appSettings/>
12 <connectionStrings>
13 <add name="ConnectionString" connectionString="Data Source=sde;User ID=sde;Password=sde;Unicode=True;" 14providerName="System.Data.OracleClient"/>
15 </connectionStrings>
16 <system.web>
......
代码:
ConfigurationManager.ConnectionStrings("ConnectionString").ConnectionString
出错:
<?xml version="1.0" encoding="utf-8" ?>
<string xmlns="http://tempuri.org/">项“ConnectionString”已添加。 (D:\WEBSERVICE\ReleaseWebservice\web.config line 13)</string>
------解决方案--------------------
<connectionStrings>
<add name="ConnectionString" connectionString="Data Source=sde;User ID=sde;Password=sde;Unicode=True;" providerName="System.Data.OracleClient"/>
</connectionStrings>
name="ConnectionString"不能使用关键定,换成name="shamao"应该就没问题