Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Security > Membership

Reply
Thread Tools

Membership

 
 
Alexk@newsgroup.nospam
Guest
Posts: n/a
 
      07-31-2008
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/archi...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>

 
Reply With Quote
 
 
 
 
Misbah Arefin
Guest
Posts: n/a
 
      08-01-2008
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




"(E-Mail Removed)" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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/archi...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>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Membership permissions after publishing an ASP.NET Membership site. Tino Donderwinkel ASP .Net 2 06-18-2008 08:16 AM
Help - Setting Up Authentication via Active Directory (Group Membership) for IPSEC and WebVPN Clients on VPN3K webspider Cisco 3 12-15-2004 04:35 AM
(avaya vs. cisco) VLAN membership question NNTP Cisco 1 10-08-2004 01:49 PM
cisco switch 3350 not capable of network-layer grouping VLAN membership ? ike lozada Cisco 10 02-03-2004 12:12 AM
Application for Membership & Newspaper. Muhammad Zaheer MCSD 47 01-22-2004 12:27 AM



Advertisments