ERROR IN CREATEUSER METHOD
Posted: Tue 04 Nov 2008 16:06
I am trying to add a user through the membership framework but I am getting an error message. My web.config is configured to accept secret question and answer so I use the overload method that contains the following parameters:
* Username as string
* Password as string
* email as string
* passwordQuestion as string
* passwordAnswer as string
* IsApproved as boolean
* Status as MembershipCreateStatus
Reviewing the "aspnet_membership" table created using the InstallWebTables.sql I see that it contains a field called "isapproved" of type INT which does not correspond to the boolean IsApproved parameter in the CreateUser overloaded method.
All of the field types in the InstallWebFiles.sql (when loaded with the SQL script editor) are in bold type except those of type INT so I guess that such a type does not exist, it gets bold if I change it to INTEGER for example.
Why are boolean types defined as integer?
Is the type INT valid?
There is also a DECIMAL data type in some fields of table aspnet_webevent_events and it is not bold either.
I have tested with a boolean parameter as well as with an integer and the message is the same. In fact, the intellisense tool asks for a True or False value.
What I also did was to change the web.config file and set the requiresQuestionAnswer to false and use the oveload method that accepts username, password and email parameters and I am getting the exact same error message.
I suppose that some fields (in different) tables should be boolean because they indicate a TRUE/FALSE status.
I will appreciate your advice.
The following is the error message I get in the browser when I click the button that calls the CreateUser method.
Server Error in '/e-restdelivery' Application.
--------------------------------------------------------------------------------
invalid input syntax for integer: "False"
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: CoreLab.PostgreSql.PgSqlException: invalid input syntax for integer: "False"
Source Error:
The source code that generated this unhandled exception can only be shown when compiled in debug mode. To enable this, please follow one of the below steps, then request the URL:
1. Add a "Debug=true" directive at the top of the file that generated the error. Example:
or:
2) Add the following section to the configuration file of your application:
Note that this second technique will cause all files within a given application to be compiled in debug mode. The first technique will cause only that particular file to be compiled in debug mode.
Important: Running applications in debug mode does incur a memory/performance overhead. You should make sure that an application has debugging disabled before deploying into production scenario.
Stack Trace:
[PgSqlException (0x80004005): invalid input syntax for integer: "False"]
CoreLab.Common.Web.Providers.DbMembershipProvider.CreateUser(String username, String password, String email, String passwordQuestion, String passwordAnswer, Boolean isApproved, Object userId, MembershipCreateStatus& status) +1729
[ProviderException: An exception occurred. Please contact your administrator.]
CoreLab.Common.Web.Providers.DbMembershipProvider.CreateUser(String username, String password, String email, String passwordQuestion, String passwordAnswer, Boolean isApproved, Object userId, MembershipCreateStatus& status) +2083
System.Web.Security.Membership.CreateUser(String username, String password, String email, String passwordQuestion, String passwordAnswer, Boolean isApproved, Object providerUserKey, MembershipCreateStatus& status) +224
System.Web.Security.Membership.CreateUser(String username, String password, String email, String passwordQuestion, String passwordAnswer, Boolean isApproved, MembershipCreateStatus& status) +28
Membresia_NuevoUsuario.btnNuevo_Click(Object sender, EventArgs e) +118
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +105
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +107
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1746
* Username as string
* Password as string
* email as string
* passwordQuestion as string
* passwordAnswer as string
* IsApproved as boolean
* Status as MembershipCreateStatus
Reviewing the "aspnet_membership" table created using the InstallWebTables.sql I see that it contains a field called "isapproved" of type INT which does not correspond to the boolean IsApproved parameter in the CreateUser overloaded method.
All of the field types in the InstallWebFiles.sql (when loaded with the SQL script editor) are in bold type except those of type INT so I guess that such a type does not exist, it gets bold if I change it to INTEGER for example.
Why are boolean types defined as integer?
Is the type INT valid?
There is also a DECIMAL data type in some fields of table aspnet_webevent_events and it is not bold either.
I have tested with a boolean parameter as well as with an integer and the message is the same. In fact, the intellisense tool asks for a True or False value.
What I also did was to change the web.config file and set the requiresQuestionAnswer to false and use the oveload method that accepts username, password and email parameters and I am getting the exact same error message.
I suppose that some fields (in different) tables should be boolean because they indicate a TRUE/FALSE status.
I will appreciate your advice.
The following is the error message I get in the browser when I click the button that calls the CreateUser method.
Server Error in '/e-restdelivery' Application.
--------------------------------------------------------------------------------
invalid input syntax for integer: "False"
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: CoreLab.PostgreSql.PgSqlException: invalid input syntax for integer: "False"
Source Error:
The source code that generated this unhandled exception can only be shown when compiled in debug mode. To enable this, please follow one of the below steps, then request the URL:
1. Add a "Debug=true" directive at the top of the file that generated the error. Example:
or:
2) Add the following section to the configuration file of your application:
Note that this second technique will cause all files within a given application to be compiled in debug mode. The first technique will cause only that particular file to be compiled in debug mode.
Important: Running applications in debug mode does incur a memory/performance overhead. You should make sure that an application has debugging disabled before deploying into production scenario.
Stack Trace:
[PgSqlException (0x80004005): invalid input syntax for integer: "False"]
CoreLab.Common.Web.Providers.DbMembershipProvider.CreateUser(String username, String password, String email, String passwordQuestion, String passwordAnswer, Boolean isApproved, Object userId, MembershipCreateStatus& status) +1729
[ProviderException: An exception occurred. Please contact your administrator.]
CoreLab.Common.Web.Providers.DbMembershipProvider.CreateUser(String username, String password, String email, String passwordQuestion, String passwordAnswer, Boolean isApproved, Object userId, MembershipCreateStatus& status) +2083
System.Web.Security.Membership.CreateUser(String username, String password, String email, String passwordQuestion, String passwordAnswer, Boolean isApproved, Object providerUserKey, MembershipCreateStatus& status) +224
System.Web.Security.Membership.CreateUser(String username, String password, String email, String passwordQuestion, String passwordAnswer, Boolean isApproved, MembershipCreateStatus& status) +28
Membresia_NuevoUsuario.btnNuevo_Click(Object sender, EventArgs e) +118
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +105
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +107
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1746