By default, ASP.NET will use a local file based database to store the login information.
If you want to use a different database, you need to do a couple of things:
- Set up the Remote Database using aspnet_regsql.exe (usually found in C:\Windows\Microsoft.NET\Framework\v2.0.50727) - running this will start it in GUI mode, allowing you select a server and database to add the tables and stored procs to.
- Configure your web site to use this database. There are a few of places you need to do this:
In the ConnectionStrings section of the web.config add your new ConnectionString:
<add
name="zhpCoreContentConnectionString"
connectionString="Data Source=Hobbiton\SqlExpress;Initial Catalog=zhpCoreContent;Integrated Security=True"
providerName="System.Data.SqlClient"/>
In the MembershipProvider section of the web.config, ensure the ConnectionString attribute is set to the same name as your connection string (other settings elided for berevity):
<membership>
<providers>
<add
connectionStringName="zhpCoreContentConnectionString"
applicationName="/doodle"
name="AspNetSqlMembershipProvider"
type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
</providers>
</membership>
If you are using Roles or Profiles you'll want to ensure that they are also using your connectionstring to store everything together, and ensure that the applicationName attribute is common between them.