Hello Chris,
I hope you are doing well. I have added a few fields in the aspnet_Users table e.g FirstName,LastName etc.
Wrote my CustomMembershipProvider extending the MembershipProvider class and CustomMembershipUser.
I have checked my custom membership provider and it works well on fetching the users and editing as well but i am unable to create the user.
While debugging, i realized that for create user(even i have overriden this function), my custom method aint getting called instead SqlMembershipProvider's createuser function is on the run.
Here is the full exception from log.
Application error when access /SitePages/Home.aspx, Error=Cannot insert the value NULL into column 'FirstName', table 'aspnetdb.dbo.aspnet_Users'; column does not allow nulls. INSERT fails. The INSERT statement conflicted with the FOREIGN KEY constraint "FK__aspnet_Me__UserI__22AA2996". The conflict occurred in database "aspnetdb", table "dbo.aspnet_Users", column 'UserId'. The statement has been terminated. The statement has been terminated.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action
at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at Sy__stem.Web.Security.SqlMembershipProvider.CreateUser(String username, String password, String email, String passwordQuestion, String passwordAnswer, Boolean isApproved, Object providerUserKey, MembershipCreateStatus& status) __
at System.Web.UI.WebControls.CreateUserWizard.AttemptCreateUser()
at System.Web.UI.WebControls.CreateUserWizard.OnNextButtonClick(WizardNavigationEventArgs e)
at System.Web.UI.WebControls.Wizard.OnBubbleEvent(Object source, EventArgs e)
at System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
Your help would be highly appriciated.
Thanks,
Shoaib Younus
I hope you are doing well. I have added a few fields in the aspnet_Users table e.g FirstName,LastName etc.
Wrote my CustomMembershipProvider extending the MembershipProvider class and CustomMembershipUser.
I have checked my custom membership provider and it works well on fetching the users and editing as well but i am unable to create the user.
While debugging, i realized that for create user(even i have overriden this function), my custom method aint getting called instead SqlMembershipProvider's createuser function is on the run.
Here is the full exception from log.
Application error when access /SitePages/Home.aspx, Error=Cannot insert the value NULL into column 'FirstName', table 'aspnetdb.dbo.aspnet_Users'; column does not allow nulls. INSERT fails. The INSERT statement conflicted with the FOREIGN KEY constraint "FK__aspnet_Me__UserI__22AA2996". The conflict occurred in database "aspnetdb", table "dbo.aspnet_Users", column 'UserId'. The statement has been terminated. The statement has been terminated.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action
1 wrapCloseInAction)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource
1 completion, Int32 timeout, Task& task, Boolean asyncWrite)
at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at Sy__stem.Web.Security.SqlMembershipProvider.CreateUser(String username, String password, String email, String passwordQuestion, String passwordAnswer, Boolean isApproved, Object providerUserKey, MembershipCreateStatus& status) __
at System.Web.UI.WebControls.CreateUserWizard.AttemptCreateUser()
at System.Web.UI.WebControls.CreateUserWizard.OnNextButtonClick(WizardNavigationEventArgs e)
at System.Web.UI.WebControls.Wizard.OnBubbleEvent(Object source, EventArgs e)
at System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
Your help would be highly appriciated.
Thanks,
Shoaib Younus