Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.Data.SqlClient.SqlException: Could not find stored procedure 'dbo.aspnet_CheckSchemaVersion'.

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace: 


[SqlException (0x80131904): Could not find stored procedure '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) +162
   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 connection, 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.Security.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(Object source, EventArgs e) +101
   System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +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(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5563



        protected void SetDestinationURL(object sender, EventArgs e)
        {
            TextBox txtUsername = (TextBox)lgLogin.FindControl("UserName");

            if (loginMember())
                Response.Redirect("~/Member/Home.aspx?Username=" + txtUsername.Text);
            else if (loginManager())
                Response.Redirect("~/Manager/Home.aspx?Username=" + txtUsername.Text);
            else
                Alert.Show("Unauthorized User Access");
        }

        protected Boolean loginMember()
        {
            TextBox txtID = (TextBox)lgLogin.FindControl("UserName");
            TextBox txtPassword = (TextBox)lgLogin.FindControl("Password");

            SqlConnection conLogin = new SqlConnection(ConfigurationManager.ConnectionStrings["connMSJ"].ConnectionString);
            SqlCommand cmdLogin;
            conLogin.Open();
            cmdLogin = new SqlCommand("SELECT Username, Password FROM Member WHERE (UserName=@ID AND Password=@Pass)", conLogin);
            cmdLogin.Parameters.AddWithValue("@ID", txtID.Text);
            cmdLogin.Parameters.AddWithValue("@Pass", txtPassword.Text);
            SqlDataReader myReader = cmdLogin.ExecuteReader();
            if (myReader.Read())
                return true;
            else
                return false;   
        }

        protected Boolean loginManager()
        {
            TextBox txtID = (TextBox)lgLogin.FindControl("UserName");
            TextBox txtPassword = (TextBox)lgLogin.FindControl("Password");

            SqlConnection conLogin = new SqlConnection(ConfigurationManager.ConnectionStrings["connMSJ"].ConnectionString);
            SqlCommand cmdLogin;
            cmdLogin = new SqlCommand("SELECT Username, Password FROM Manager WHERE (UserName=@ID AND Password=@Pass)", conLogin);
            cmdLogin.Parameters.AddWithValue("@ID", txtID.Text);
            cmdLogin.Parameters.AddWithValue("@Pass", txtPassword.Text);
            conLogin.Open();
            SqlDataReader myReader = cmdLogin.ExecuteReader();
            if (myReader.Read())
                return true;
            else
                return false;
        }

When i testing a failure data (Invalid User; Doesn't match my own database data), it provide this error to me.
I am using my own database to detect whether is a member or manager, else will pop out a alert message box and return to home page.
For the design, i am just drag and drop from ASP.NET tool (CreateUserWizard & Login).
Thanks for advanced

Recommended Answers

All 5 Replies

Based on your question, I think you are a noob to asp.net.

Anyway,I wanna ask a questions.

1) According to your code, you are using text command(query). Then why should it provide a error like that(such as procedure not found exception)?

Soln:
try to create it on your own. no sweat. there are several tutorils available step by step code.

Sugestion:

TRY TO ANALYZE WHY THE ERROR CAME AND THINK BACK WHERE YOU HAVE DECLARED THE PROCEDURE(THE CAUSE FOR THE EEROR) IN YOUR PROGRAM....

Hope this helps you..

Have a happy coding...:-D

in fact, i am a noob to asp.net because had learnt for one semester only. :(

Problem solved by designing by own.
but i am wandering why cause that error?

You mentioned earlier that you copied some codes from the default login program.

Well you probably copied some unnecessary codes. thats the main cause of the problem.

If you have any question, feel free to ask else kindly marked the problem as solved...

Anyway, Have a happy coding..:-D

i don't even know which code is unnecessary one.
Since the AsP.Net provide this tools, we must kindly use them :P
Otherwise, later ASP.NET Company cry LoL.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.