VistaDB 5
Sample web.config for membership providers

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. 

The example below is for .NET 4.0 and later.  If you're using an earlier version of .NET change VistaDB.5.Web.NET40 to VistaDB.5.Web.NET20.  They are functionally identical.
Membership Provider Web Config
Copy Code
    <membership defaultProvider="AspNetVistaDBMembershipProvider">
        <add connectionStringName="ConnectionString" name="AspNetVistaDBMembershipProvider" 
          type="VistaDB.Web.VistaDBMembershipProvider, VistaDB.5.Web.NET40, Version=, 
          Culture=neutral, PublicKeyToken=f5930b27126de908" />
    <profile defaultProvider="AspNetVistaDBProfileProvider" enabled="true">
        <add connectionStringName="ConnectionString" name="AspNetVistaDBProfileProvider" 
         type="VistaDB.Web.VistaDBProfileProvider, VistaDB.5.Web.NET40, Version=, 
         Culture=neutral, PublicKeyToken=f5930b27126de908" />
        <group name="UserInfo">
          <add name="Name" type="System.String" allowAnonymous="true" />
    <roleManager defaultProvider="AspNetVistaDBRoleProvider" enabled="true">
        <add connectionStringName="ConnectionString" name="AspNetVistaDBRoleProvider" 
                type="VistaDB.Web.VistaDBRoleProvider, VistaDB.5.Web.NET40, Version=, 
           Culture=neutral, PublicKeyToken=f5930b27126de908" />

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
    <add name="ConnectionString" connectionString="Data Source='|DataDirectory|\aspnetdb.vdb5'" providerName="System.Data.VistaDB5" />

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

See Also