Re: Membership



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




"Alexk@xxxxxxxxxxxxxxxx" <Alex.O.Koranteng@xxxxxxxxxxxxx> wrote in message news:eJsnP418IHA.3848@xxxxxxxxxxxxxxxxxxxxxxx
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/archive/2006/04/22/Always-set-the-_2200_applicationName_2200_-property-when-configuring-ASP.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>


.



Relevant Pages

  • Membership
    ... I recreated the first membership sample from Scott's membership series from 4guysfrom Rolla.com and got the following error. ... An unhandled exception occurred during the execution of the current web request. ... Exception Details: System.Data.SqlClient.SqlException: Cannot open database "aspnetdb" requested by the login. ... <!-- You should ALWAYS customize the Membership provider and specify an applicationName... ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: Runtime Syntax Checker
    ... If any Tcl command sets a return code other than zero, ... script to abort, but any following scripts will execute. ... In C, you can ignore errors, execution ... The caller must then handle the exception. ...
    (comp.lang.tcl)
  • Re: Updating a DB via SQL is giving me a headache
    ... problem will never be executed using the Try/Catch block, ... Connection was certainly created and opened, ... If so, null is not an Integer, and that could throw an exception. ... is handled, execution continues. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Updating a DB via SQL is giving me a headache
    ... This means that SOMETHING being done in that line is throwing an exception, not necessarily the SQL Statement, which in fact, since you tested it in Query Analyzer, works. ... Since no code from that class was posted, I can't guarantee that, while the Connection was certainly created and opened, I don't know everything about the Connection. ... Also, in the same "misuse of Try/Catch" department, your Catch block is setting the return value of your function, but note that when an Exception is handled, execution continues. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Web service runs infinitely on IIS5.0 and .NET2.0 using windows 20
    ... Currently we poll a SQL server Db at regular intervals to ... At all cases of exception we wait for 20 seconds more using sleep and retry ... Enabling trace and increasing execution timeout did not help. ... Failed to process request. ...
    (microsoft.public.dotnet.framework.aspnet.webservices)