日期:2014-05-18  浏览次数:20494 次

asp.net配置问题(C#,odbc)
我想通过对webconfig的配置,在网站的安全下配置用户。但是配置老是提示无法链接数据库,请问是怎么回事?我的配置如下:
<configuration>
<appSettings/>
<connectionStrings>
<add name="ConnectionString" connectionString="Dsn=ASA 9.0 Client Sample;uid=dba;pwd=sql;database=MFW" providerName="System.Data.Odbc"/>
<add name="MFWConnectionString" connectionString="Dsn=ASA 9.0 Client Sample;uid=dba;database=MFW;pwd=sql" providerName="System.Data.Odbc"/>
</connectionStrings>
<system.web>

<httpHandlers>
<add path="Reserved.ReportViewerWebControl.axd" verb="*" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" validate="false"/>
</httpHandlers>
<compilation debug="true">
<buildProviders>
<add extension=".rdlc" type="Microsoft.Reporting.RdlBuildProvider, Microsoft.ReportViewer.Common, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
</buildProviders>
</compilation>
<authentication mode="Forms"/>
  <authorization>
  <allow users="*" />  
  </authorization>
<membership defaultProvider="AdbcMembershipProvider">
  <providers>
  <add connectionStringName="ConnectionString" enablePasswordRetrieval="false"
  enablePasswordReset="true" requiresQuestionAndAnswer="true" applicationName="/"
  requiresUniqueEmail="false" passwordFormat="Hashed" maxInvalidPasswordAttempts="5"
  minRequiredPasswordLength="7" minRequiredNonalphanumericCharacters="1"
  passwordAttemptWindow="10" passwordStrengthRegularExpression=""  
  name="AdbcMembershipProvider" type="System.Web, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
  </providers>
  </membership>
<profile>
<providers>
<clear/>
<add name="AdbcMembershipProvider" connectionStringName="ConnectionString" applicationName="/" type="System.Web, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
</providers>
</profile>
<roleManager defaultProvider="AdbcMembershipProvider">
  <providers>
  <add connectionStringName="ConnectionString" applicationName="/"
  name="AdbcMembershipProvider" type="System.Web, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
  </providers>
  </roleManager>
</system.web>

------解决方案--------------------
用这种试下啊:
<add key="MsSql" value="server=***.***.**.***;database=***;uid=sa;pwd=sa;" />