ASP.NET - Web.config登录错误找不到存储过程'dbo.aspnet_CheckSchemaVersion'

Bri*_*thy 4 asp.net forms-authentication login web-config

我正在使用表单身份验证和gettnig以下错误:

'/'应用程序中的服务器错误.

找不到存储过程'dbo.aspnet_CheckSchemaVersion'.描述:执行当前Web请求期间发生未处理的异常.请查看堆栈跟踪以获取有关错误及其源自代码的位置的更多信息.

异常详细信息:System.Data.SqlClient.SqlException:找不到存储过程'dbo.aspnet_CheckSchemaVersion'.

来源错误:

在执行当前Web请求期间生成了未处理的异常.可以使用下面的异常堆栈跟踪来识别有关异常的起源和位置的信息.

堆栈跟踪:

[SqlException(0x80131904):找不到存储过程'dbo.aspnet_CheckSchemaVersion'.]
System.Data.SqlClient.SqlConnection.OnError(SqlException exception,Boolean breakConnection)+2030802
System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception,Boolean breakConnection)+5009584
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()+234
System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior,SqlCommand cmdHandler,SqlDataReader dataStream,BulkCopySimpleResultSet bulkCopyHandler,TdsParserStateObject stateObj)+2275
System.Data.SqlClient. SqlCommand.FinishExecuteReader(SqlDataReader ds,RunBehavior runBehavior,String resetOptionsString)+215
System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior,RunBehavior runBehavior,Boolean returnStream,Boolean async)+987
System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior) cmdBehavior,RunBehavior runBehavior,Boolean returnStream,String method,DbAsyncResult result)+1 62
System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result,String methodName,Boolean sendToPipe)+178
System.Data.SqlClient.SqlCommand.ExecuteNonQuery()+137
System.Web.Util.SecUtility.CheckSchemaVersion(ProviderBase provider,SqlConnection连接) ,String [] features,String version,Int32&schemaVersionCheck)+392
System.Web.Security.SqlMembershipProvider.CheckSchemaVersion(SqlConnection connection)+84
System.Web.Security.SqlMembershipProvider.GetPasswordWithFormat(String username,Boolean updateLastLoginActivityDate,Int32&status,String&password ,Int32&passwordFormat,String&passwordSalt,Int32&failedPasswordAttemptCount,Int32&failedPasswordAnswerAttemptCount,Boolean&isApproved,DateTime&lastLoginDate,DateTime&lastActivityDate)+827
System.Web.Security.SqlMembershipProvider.CheckPassword(String username,String password,Boolean updateLastLoginActivityDate,Boolean failIfNotApproved,String&salt,Int32& passwordFormat)+105
System.Web.Securit y.SqlMembershipProvider.ValidateUser(String username,String password)+106
System.Web.UI.WebControls.Login.AuthenticateUsingMembershipProvider(AuthenticateEventArgs e)+60
System.Web.UI.WebControls.Login.OnAuthenticate(AuthenticateEventArgs e)+129 System. Web.UI.WebControls.Login.AttemptLogin()127
System.Web.UI.WebControls.Login.OnBubbleEvent(对象源,EventArgs的)101 System.Web.UI.Control.RaiseBubbleEvent(对象源,EventArgs的参数)+ 37
System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e)+125
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)+167
System.Web.UI.WebControls.Button.System.Web.UI .IPostBackEventHandler.RaisePostBackEvent(String eventArgument)+10
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl,String eventArgument)+13
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)+36 System.Web.UI.Page .ProcessRequestMain(布尔includeStagesBeforeAsyncPoint,布尔includeStagesAfterAsyncPoi nt)+5563

这是我的web.config文件中的代码:

<?xml version="1.0"?>

<configuration>
<connectionStrings>
    <add name="OleConnectionStringSource" connectionString="Data Source=alg-sql01;Initial Catalog=PriceFinder;User ID=PriceFinderUser;Password=******;Integrated Security=false"
     providerName="System.Data.SqlClient" />
    <add name="OleConnectionStringTarget" connectionString="Data Source=alg-sql01;Initial Catalog=PriceFinder;User ID=PriceFinderUser;Password=******;Integrated Security=false"
     providerName="System.Data.OleDb;" />
    <add name="PriceFinderConnectionString" connectionString="Data Source=alg-sql01;Initial Catalog=PriceFinder;Integrated Security=True"
     providerName="System.Data.SqlClient" />
    <add name="PriceFinderConnectionString2" connectionString="Data Source=alg-sql01;Initial Catalog=PriceFinder;Integrated Security=True"
     providerName="System.Data.SqlClient" />
</connectionStrings>

<system.web>
<compilation debug="true" targetFramework="4.0" />

<authentication mode="Forms">
  <forms loginUrl="~/default.aspx" timeout="2880" />
</authentication>

 <membership>
  <providers>
    <clear/>
      <add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="OleConnectionStringSource"
         enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false"
         maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10"
         applicationName="/" />  
  </providers>
</membership> 

<profile>
  <providers>
    <clear/>
   <add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="ApplicationServices" applicationName="/"/> 
  </providers>
</profile>

<roleManager enabled="false">
  <providers>
    <clear/>
      <add name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="ApplicationServices" applicationName="/" />
    <add name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider" applicationName="/" /> 
  </providers>
</roleManager>
Run Code Online (Sandbox Code Playgroud)

我该如何解决这个错误?你需要看到任何其他文件吗?谢谢!

Tim*_*ter 9

您是否在SQL-Server中创建了表和存储过程?

如果您使用MS Sql-Server作为DBMS,请查看此链接并执行aspnet_regsql.exe.