Membership

Discussion in 'ASP .Net Security' started by Alexk@newsgroup.nospam, Aug 1, 2008.

  1. Guest

    I recreated the first membership sample from Scott's membership series from
    4guysfrom Rolla.com and got the following error. Any suggestions

    Thanks
    Alex.


    Cannot open database "aspnetdb" requested by the login. The login failed.
    Login failed for user 'Alex-PC\test'.
    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: Cannot open database
    "aspnetdb" requested by the login. The login failed.
    Login failed for user 'Alex-PC\test'.

    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.


    This is the listing for my web.config file
    <configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">


    <!-- You should ALWAYS customize the Membership provider and specify an
    applicationName... see
    http://weblogs.asp.net/scottgu/arch...P.NET-2.0-Membership-and-other-Providers.aspx
    for more details... -->
    <!--membership defaultProvider="CustomizedProvider">
    <providers>
    <add name="CustomizedProvider"
    type="System.Web.Security.SqlMembershipProvider"
    connectionStringName="LocalSqlServer" applicationName="/"
    minRequiredPasswordLength="5" minRequiredNonalphanumericCharacters="0"/>
    </providers>
    </membership>-->

    <!--The following code example shows how to configure an ASP.NET
    application to use the
    SqlMembershipProvider provider to store and retrieve user account
    information.-->

    <connectionStrings>
    <add name="SqlServices"
    connectionString="Data Source=Alex-PC\SVAIO2005;Integrated
    Security=SSPI;Initial Catalog=aspnetdb;" />

    </connectionStrings>
    <system.web>
    <authentication mode="Forms"/>

    <membership
    defaultProvider="SqlProvider"
    userIsOnlineTimeWindow="20">
    <providers>
    <remove name="AspNetSqlProvider" />
    <add name="SqlProvider"
    type="System.Web.Security.SqlMembershipProvider"
    connectionStringName="SqlServices"
    enablePasswordRetrieval="false"
    enablePasswordReset="true"
    requiresQuestionAndAnswer="true"
    passwordFormat="Hashed"
    applicationName="/" />
    </providers>
    </membership>
    <compilation debug="true"/>

    </system.web>




    </configuration>
    , Aug 1, 2008
    #1
    1. Advertising

  2. You need to setup the membership db... you need to execute aspnet_regsql.exe
    from the folder C:\Windows\Microsoft.NET\Framework\v2.0.50727 follow the
    setup wizard

    --
    Misbah Arefin
    https://mcp.support.microsoft.com/profile/MISBAH.AREFIN
    http://dotnethitman.spaces.live.com
    http://www.linkedin.com/in/misbaharefin




    "" <> wrote in message
    news:...
    > I recreated the first membership sample from Scott's membership series
    > from 4guysfrom Rolla.com and got the following error. Any suggestions
    >
    > Thanks
    > Alex.
    >
    >
    > Cannot open database "aspnetdb" requested by the login. The login failed.
    > Login failed for user 'Alex-PC\test'.
    > 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: Cannot open
    > database "aspnetdb" requested by the login. The login failed.
    > Login failed for user 'Alex-PC\test'.
    >
    > 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.
    >
    >
    > This is the listing for my web.config file
    > <configuration
    > xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
    >
    >
    > <!-- You should ALWAYS customize the Membership provider and specify an
    > applicationName... see
    > http://weblogs.asp.net/scottgu/arch...P.NET-2.0-Membership-and-other-Providers.aspx
    > for more details... -->
    > <!--membership defaultProvider="CustomizedProvider">
    > <providers>
    > <add name="CustomizedProvider"
    > type="System.Web.Security.SqlMembershipProvider"
    > connectionStringName="LocalSqlServer" applicationName="/"
    > minRequiredPasswordLength="5" minRequiredNonalphanumericCharacters="0"/>
    > </providers>
    > </membership>-->
    >
    > <!--The following code example shows how to configure an ASP.NET
    > application to use the
    > SqlMembershipProvider provider to store and retrieve user account
    > information.-->
    >
    > <connectionStrings>
    > <add name="SqlServices"
    > connectionString="Data Source=Alex-PC\SVAIO2005;Integrated
    > Security=SSPI;Initial Catalog=aspnetdb;" />
    >
    > </connectionStrings>
    > <system.web>
    > <authentication mode="Forms"/>
    >
    > <membership
    > defaultProvider="SqlProvider"
    > userIsOnlineTimeWindow="20">
    > <providers>
    > <remove name="AspNetSqlProvider" />
    > <add name="SqlProvider"
    > type="System.Web.Security.SqlMembershipProvider"
    > connectionStringName="SqlServices"
    > enablePasswordRetrieval="false"
    > enablePasswordReset="true"
    > requiresQuestionAndAnswer="true"
    > passwordFormat="Hashed"
    > applicationName="/" />
    > </providers>
    > </membership>
    > <compilation debug="true"/>
    >
    > </system.web>
    >
    >
    >
    >
    > </configuration>
    >
    >
    Misbah Arefin, Aug 1, 2008
    #2
    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. Jan Nielsen

    Checking group membership

    Jan Nielsen, Sep 2, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    1,017
    Jan Nielsen
    Sep 2, 2003
  2. Petra Hübner
    Replies:
    0
    Views:
    443
    Petra Hübner
    Feb 16, 2004
  3. cameron

    User Group Membership

    cameron, Jun 9, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    2,120
    John Saunders
    Jun 10, 2004
  4. clintonG

    2.0 Membership APIs

    clintonG, Oct 14, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    364
    clintonG
    Oct 14, 2004
  5. Tino Donderwinkel
    Replies:
    2
    Views:
    752
    Tino Donderwinkel
    Jun 18, 2008
Loading...

Share This Page