사용자 정의 "CREATEUSER"를 작동 시키려고하는데 내 web.config에 문제가 있다고 생각합니다. 도움을 주셔서 감사합니다, 나는 MEMBERSHIP 섹션을 작성했지만 내 MEMBERSHIP.CREATEUSER 명령은 데이터베이스에 로그온하지 못했습니다. 오류는 "기본 데이터베이스에 로그온 할 수 없습니다."입니다. 연결 문자열을 추가했으며 이름이 내 섹션에 있습니다. 그러나 나는 붙어있다.Asp.net 멤버쉽 공급자 사용자 CreateUser
Here is the code-behind file for creating the user:
protected void submit_Click(object sender, EventArgs e)
{
Membership.CreateUser(userName.Text, passwdConfirm.Text, email.Text);
}
그리고 여기에 내 Web.config 파일이 있습니다.
<configuration>
<connectionStrings>
<add name="FVTCEntities" connectionString="metadata=res://*/Model.csdl|res://*/Model.ssdl|res://*/Model.msl;provider=System.Data.SqlClient;provider connection string="data source=SFP;attachdbfilename=H:\ASP.Net\FVRG\FVRG\App_Data\FVTC.mdf;integrated security=True;multipleactiveresultsets=True;App=EntityFramework"" providerName="System.Data.EntityClient" />
<add name="dbMembership" connectionString="Data Source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=H:\ASP.Net\FVRG\FVRG\App_Data\ASPNETDB.MDF;User Instance=true" providerName="System.Data.SqlClient" />
</connectionStrings>
<system.web>
<authorization>
<allow roles="ADMIN" />
<allow roles="GUEST" />
</authorization>
<roleManager enabled="true" />
<authentication mode="Forms" />
<compilation debug="true" targetFramework="4.0" />
<membership>
<providers>
<clear/>
<add name="AspNetSqlMembershipProvider"
type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
connectionStringName="dbMembership"
enablePasswordRetrieval="false"
enablePasswordReset="true"
requiresQuestionAndAnswer="false"
requiresUniqueEmail="true"
passwordFormat="Hashed"
maxInvalidPasswordAttempts="5"
minRequiredPasswordLength="7"
minRequiredNonalphanumericCharacters="1"
passwordAttemptWindow="10"
passwordStrengthRegularExpression=""
applicationName="/FVRG" />
</providers>
</membership>
</system.web>
<appSettings>
<add key="DatabaseConnection" value="Data Source=.\SQLEXPRESS;AttachDbFilename=H:\ASP.Net\FVRG\FVRG\App_Data\FVTC.mdf;Integrated Security=True;User Instance=True" />
</appSettings>
</configuration>
미리 도움을 청하십시오!
연결 문자열이 올바른지 확인할 수 있습니까? 지정하는 conncectionStringName은 "dbMembership"이지만 코드에 connectionStrings> 만 포함되어 있으므로이를 볼 수 없습니다. – atbebtg
전체 Web.config 파일을 삽입했습니다. – Susan