Page 1 of 1

Membership.CreateUser error

Posted: Fri 11 Aug 2006 02:55
by chris@byteme
When calling "createuser" as follows:

Dim theMem As MembershipUser = Membership.CreateUser(txtUsr.txt, txtPwd.Text)

I get the following error:

System.Configuration.Provider.ProviderException: An exception occurred. Please contact your administrator. ---> System.ArgumentNullException: String reference not set to an instance of a String. Parameter name: s at System.Text.Encoding.GetBytes(String s) at CoreLab.Common.Web.Providers.DbMembershipProvider.b(String A_0) at CoreLab.Common.Web.Providers.DbMembershipProvider.CreateUser(String username, String password, String email, String passwordQuestion, String passwordAnswer, Boolean isApproved, Object userId, MembershipCreateStatus& status) --- End of inner exception stack trace --- at CoreLab.Common.Web.Providers.DbMembershipProvider.CreateUser(String username, String password, String email, String passwordQuestion, String passwordAnswer, Boolean isApproved, Object userId, MembershipCreateStatus& status) at System.Web.Security.Membership.CreateUser(String username, String password, String email, String passwordQuestion, String passwordAnswer, Boolean isApproved, Object providerUserKey, MembershipCreateStatus& status) at System.Web.Security.Membership.CreateUser(String username, String password, String email, String passwordQuestion, String passwordAnswer, Boolean isApproved, MembershipCreateStatus& status) at System.Web.Security.Membership.CreateUser(String username, String password, String email) at System.Web.Security.Membership.CreateUser(String username, String password) at reg.wizReg_NextButtonClick(Object sender, WizardNavigationEventArgs e) in C:\Documents and Settings\Chris\My Documents\Visual Studio 2005\WebSites\books\reg.aspx.vb:line 54

Posted: Fri 11 Aug 2006 04:44
by chris@byteme
Okay, more info: I have "requiresQuestionAndAnswer="false"" in web.config, but this error seems to be related to the error "InvalidQuestion". So perhaps it's expecting a question/answer even though I've told it not to?

I know that the case is important in web.config - do I have it right?

Posted: Fri 11 Aug 2006 07:37
by Paul
This error was discussed in http://crlab.com/forums/viewtopic.php?t=6618. This fix will be included in the next MySQLDirect .NET build.