membership/roles create user problem

Discussion in 'ASP .Net Security' started by John, Aug 28, 2006.

  1. John

    John Guest

    Hi

    I have a web service asmx file in a sub folders of site app root folder.
    With in the web service I am trying to cerate the user as below;

    <WebMethod()> _
    Public Function CreateUser(ByVal Username As String, ByVal Password As
    String, ByVal Email As String, ByRef ErrMsg As String) As Boolean

    Dim newUser As MembershipUser = Membership.CreateUser(Username, Password,
    Email, passwordQuestion, passwordAnswer, True, status)
    If (newUser Is Nothing) Then
    ErrMsg = GetErrorMessage(status)
    CreateUser = False
    true
    CreateUser = True
    End If
    End Function

    The user seems to be created fine but it does not appear in the Web Site
    Administration Tool list of users. When I look in the aspnet db, the user is
    created in the vw_aspnet_Users table but not in any of the rest of the
    tables such as vw_aspnet_MembershipUsers.

    What is wrong and how can it be fixed?

    Thanks

    Regards
    John, Aug 28, 2006
    #1
    1. Advertising

  2. John

    John Guest

    I think I have cracked this one.

    Thanks

    Regards

    "John" <> wrote in message
    news:%...
    > Hi
    >
    > I have a web service asmx file in a sub folders of site app root folder.
    > With in the web service I am trying to cerate the user as below;
    >
    > <WebMethod()> _
    > Public Function CreateUser(ByVal Username As String, ByVal Password As
    > String, ByVal Email As String, ByRef ErrMsg As String) As Boolean
    >
    > Dim newUser As MembershipUser = Membership.CreateUser(Username, Password,
    > Email, passwordQuestion, passwordAnswer, True, status)
    > If (newUser Is Nothing) Then
    > ErrMsg = GetErrorMessage(status)
    > CreateUser = False
    > true
    > CreateUser = True
    > End If
    > End Function
    >
    > The user seems to be created fine but it does not appear in the Web Site
    > Administration Tool list of users. When I look in the aspnet db, the user
    > is created in the vw_aspnet_Users table but not in any of the rest of the
    > tables such as vw_aspnet_MembershipUsers.
    >
    > What is wrong and how can it be fixed?
    >
    > Thanks
    >
    > Regards
    >
    John, Aug 28, 2006
    #2
    1. Advertising

  3. What was it?

    "John" <> wrote in message
    news:...
    >I think I have cracked this one.
    >
    > Thanks
    >
    > Regards
    >
    > "John" <> wrote in message
    > news:%...
    >> Hi
    >>
    >> I have a web service asmx file in a sub folders of site app root folder.
    >> With in the web service I am trying to cerate the user as below;
    >>
    >> <WebMethod()> _
    >> Public Function CreateUser(ByVal Username As String, ByVal Password As
    >> String, ByVal Email As String, ByRef ErrMsg As String) As Boolean
    >>
    >> Dim newUser As MembershipUser = Membership.CreateUser(Username, Password,
    >> Email, passwordQuestion, passwordAnswer, True, status)
    >> If (newUser Is Nothing) Then
    >> ErrMsg = GetErrorMessage(status)
    >> CreateUser = False
    >> true
    >> CreateUser = True
    >> End If
    >> End Function
    >>
    >> The user seems to be created fine but it does not appear in the Web Site
    >> Administration Tool list of users. When I look in the aspnet db, the user
    >> is created in the vw_aspnet_Users table but not in any of the rest of the
    >> tables such as vw_aspnet_MembershipUsers.
    >>
    >> What is wrong and how can it be fixed?
    >>
    >> Thanks
    >>
    >> Regards
    >>

    >
    >
    Ken Cox [Microsoft MVP], Aug 29, 2006
    #3
  4. John

    John Guest

    Actually the method Membership.CreateUser(Username, Password,Email,
    passwordQuestion, passwordAnswer, True, status) was failing and user was not
    being properly created. I used Membership.CreateUser(Username,
    Password,Email) variation as I did not need/use passwordQuestion ,
    passwordAnswer etc. and it worked.

    Regards


    "Ken Cox [Microsoft MVP]" <> wrote in message
    news:...
    > What was it?
    >
    > "John" <> wrote in message
    > news:...
    >>I think I have cracked this one.
    >>
    >> Thanks
    >>
    >> Regards
    >>
    >> "John" <> wrote in message
    >> news:%...
    >>> Hi
    >>>
    >>> I have a web service asmx file in a sub folders of site app root folder.
    >>> With in the web service I am trying to cerate the user as below;
    >>>
    >>> <WebMethod()> _
    >>> Public Function CreateUser(ByVal Username As String, ByVal Password As
    >>> String, ByVal Email As String, ByRef ErrMsg As String) As Boolean
    >>>
    >>> Dim newUser As MembershipUser = Membership.CreateUser(Username,
    >>> Password, Email, passwordQuestion, passwordAnswer, True, status)
    >>> If (newUser Is Nothing) Then
    >>> ErrMsg = GetErrorMessage(status)
    >>> CreateUser = False
    >>> true
    >>> CreateUser = True
    >>> End If
    >>> End Function
    >>>
    >>> The user seems to be created fine but it does not appear in the Web Site
    >>> Administration Tool list of users. When I look in the aspnet db, the
    >>> user is created in the vw_aspnet_Users table but not in any of the rest
    >>> of the tables such as vw_aspnet_MembershipUsers.
    >>>
    >>> What is wrong and how can it be fixed?
    >>>
    >>> Thanks
    >>>
    >>> Regards
    >>>

    >>
    >>

    >
    >
    John, Aug 30, 2006
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. John
    Replies:
    3
    Views:
    1,523
  2. =?Utf-8?B?TWFya0F1cml0?=

    2.0 membership roles database problem

    =?Utf-8?B?TWFya0F1cml0?=, Feb 7, 2007, in forum: ASP .Net
    Replies:
    1
    Views:
    356
    sloan
    Feb 7, 2007
  3. Jéjé
    Replies:
    0
    Views:
    222
    Jéjé
    Sep 27, 2005
  4. Mark Riley

    Problem using ASP.NET 2.0 Membership and Roles

    Mark Riley, Mar 29, 2006, in forum: ASP .Net Security
    Replies:
    1
    Views:
    114
    Mark Riley
    Mar 30, 2006
  5. John

    membership/roles create user problem

    John, Aug 28, 2006, in forum: ASP .Net Web Services
    Replies:
    3
    Views:
    145
Loading...

Share This Page