之前有建好数据库,在web.config中有:
<connectionStrings>
<add name="ConnectionString" connectionString="Data Source=machinename;Initial Catalog=mydb;Integrated Security=True" providerName="System.Data.SqlClient"/>
</connectionStrings>但是asp.net configuration 连不上数据库:
Provider Management
Could not establish a connection to the database.
If you have not yet created the SQL Server database, exit the Web Site Administration tool, use the aspnet_regsql command-line utility to create and configure the database, and then return to this tool to set the provider. 请问Login控件是如何连接到数据库,是否和datalist控件一样需要绑定到数据库?
<connectionStrings>
<add name="ConnectionString" connectionString="Data Source=machinename;Initial Catalog=mydb;Integrated Security=True" providerName="System.Data.SqlClient"/>
</connectionStrings>但是asp.net configuration 连不上数据库:
Provider Management
Could not establish a connection to the database.
If you have not yet created the SQL Server database, exit the Web Site Administration tool, use the aspnet_regsql command-line utility to create and configure the database, and then return to this tool to set the provider. 请问Login控件是如何连接到数据库,是否和datalist控件一样需要绑定到数据库?
那么Login控件是如何连接数据库的呢?
<membership>
<providers>
<remove name="AspNetSqlMembershipProvider"/>
<add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="LocalSqlServer" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="true" applicationName="/" requiresUniqueEmail="false" passwordFormat="Clear" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" passwordStrengthRegularExpression=""/>
</providers>
</membership>
connectionStringName="LocalSqlServer" 换成 connectionStringName="ConnectionString"