Configuring the Asp.Net SQLMembershipProvider

Discussion in 'ASP.NET 2.0' started by LostNSpace, Sep 2, 2007.

  1. I was successful is running the aspnet_regiis command line as outlined in KB# Q10413. This setup my aspnet_Membership tables and schemas. Next I'm having difficulty setting up the web.config files and the Login Controls for the SQLMembershipProvider. I've structured my website to allow Anonymous Users access to all pages at the Root Level and restrict Access to registered members at the "MembersOnly" Level. I have a web.config file at the root level that authenticates users from "Windows". So when the Web Browser is launched the Home Page (Index.aspx) opens for everyone. I also have a Web.config file located in the MembersOnly Folder which I've designated an Application Root.


    > A link on the Index.aspx Page (Join ...) opens the Member_Register.aspx Page which has a CreateUserWizard Control. It's supposed to use the SQLMembershipProvider to create a new user in my Membership Tables but instead I get the following Error Message:


    > SQLExpress database file auto-creation error:


    > The connection string specifies a local Sql Server Express instance using a database location within the applications App_Data directory. The provider attempted to automatically create the application services database because the provider determined that the database does not exist. The following configuration requirements are necessary to successfully check for existence of the application services database and automatically create the application services database:


    > If the applications App_Data directory does not already exist, the web server account must have read and write access to the applications directory. This is necessary because the web server account will automatically create the App_Data directory if it does not already exist.


    > If the applications App_Data directory already exists, the web server account only requires read and write access to the applications App_Data directory. This is necessary because the web server account will attempt to verify that the Sql Server Express database already exists within the applications App_Data directory. Revoking read access on the App_Data directory from the web server account will prevent the provider from correctly determining if the Sql Server Express database already exists. This will cause an error when the provider attempts to create a duplicate of an already existing database. Write access is required because the web server accounts credentials are used when creating the new database.


    > Sql Server Express must be installed on the machine.


    > The process identity for the web server account must have a local user profile. See the readme document for details on how to create a local user profile for both machine and domain accounts.


    > I don't understand this message since it's supposed to connect to my Membership Tables


    > Thanks,


    > ME
     
  2. Bruce

    Bruce DiscountASP.NET Staff

    Check your application's connection strings and make sure they point to the SQL server database.


    Bruce

    DiscountASP.NET
    www.DiscountASP.NET
     

Share This Page