asp.net无法登录或注册

时间:2011-07-31 17:07:06

标签: asp.net login

每当我尝试在我的页面上登录或注册时,我都会收到此错误:

Cannot open user default database. Login failed.
Login failed for user 'sa'.

这是我的连接字符串:

   <remove name="loginserver"/>
    <add name="loginserver" connectionString="Data Source=AHMED-PC\SQLEXPRESS;AttachDBFilename=|DataDirectory|aspnetdb.mdf;Persist Security Info=false;User ID=sa;Password=123456" providerName="System.Data.SqlClient"/>

            <providers>
            <remove name="AspNetSqlMembershipProvider"/>
            <add name="AspNetSqlMembershipProvider"
                 type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
                 connectionStringName="loginserver"
                 enablePasswordRetrieval="true"
                 enablePasswordReset="true"
                 requiresQuestionAndAnswer="false"
                 applicationName="/"
                 requiresUniqueEmail="true"
                 minRequiredPasswordLength="6"
                 minRequiredNonalphanumericCharacters="0"
                 passwordFormat="Encrypted"
                 maxInvalidPasswordAttempts="5"
                 passwordAttemptWindow="10"
                 passwordStrengthRegularExpression=""/>
        </providers>    

我通常能够正常登录或注册,但突然间我开始收到此错误。

所以问题是什么,谢谢

1 个答案:

答案 0 :(得分:0)

刚刚从sql express删除了aspnet.mdf,现在它可以正常工作