VistaDB 6
VistaDB / Developer's Guide / How To Perform Common Tasks / Use VistaDB Providers for ASP.NET Websites / Sample web.config for membership providers
In This Topic
    Sample web.config for membership providers
    In This Topic

    The following is a sample web.config section for using the custom ASP.NET membership providers for VistaDB.

    This situation usually comes up after a developer had everything working on their local development machine and tries to deploy the website to a remote server. The entries on the local developer machine.config are not automatically added to your web.config for your website. This leads to broken references when pushed to the remote server.

    Adding the Membership Provider To Your Web.Config

    These providers should be inserted within the <system.web> </system.web> tags. 

    Membership Provider Web Config
    Copy Code
        <membership defaultProvider="AspNetVistaDBMembershipProvider">
          <providers>
            <add connectionStringName="ConnectionString" name="AspNetVistaDBMembershipProvider" 
              type="VistaDB.Web.VistaDBMembershipProvider, VistaDB.6.Web, Version=6.0.0.0, 
              Culture=neutral, PublicKeyToken=f5930b27126de908" />
          </providers>
        </membership>
        <profile defaultProvider="AspNetVistaDBProfileProvider" enabled="true">
          <providers>
            <add connectionStringName="ConnectionString" name="AspNetVistaDBProfileProvider" 
             type="VistaDB.Web.VistaDBProfileProvider, VistaDB.6.Web, Version=6.0.0.0, 
             Culture=neutral, PublicKeyToken=f5930b27126de908" />
          </providers>
          <properties>
            <group name="UserInfo">
              <add name="Name" type="System.String" allowAnonymous="true" />
            </group>
          </properties>
        </profile>
        <roleManager defaultProvider="AspNetVistaDBRoleProvider" enabled="true">
          <providers>
            <add connectionStringName="ConnectionString" name="AspNetVistaDBRoleProvider" 
                    type="VistaDB.Web.VistaDBRoleProvider, VistaDB.6.Web, Version=6.0.0.0, 
               Culture=neutral, PublicKeyToken=f5930b27126de908" />
          </providers>
        </roleManager>
    

    In this specific example we are using the connection string name of "ConnectionString". This is the entry for that connection.

    Example Connection String
    Copy Code
      <connectionStrings>
        <add name="ConnectionString" connectionString="Data Source='|DataDirectory|\aspnetdb.vdb6'" providerName="System.Data.VistaDB6" />
      </connectionStrings>
    

    Note that the name of the database is aspnetdb.vdb6 and it is located in the |DataDirectory| of the current website.

    See Also