Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You can get rid of the ASPNETDB.MDF - an extraneous attached database file, and can store all your security information (users, roles) inside your custom SQL Database.</p> <p>Follow these simple steps</p> <p><strong>Step 01 - Create Security Tables in Your SQL Database</strong></p> <p>First, you need to create tables that will hold ASP.NET security information inside your SQL database. There is a wizard for that.</p> <p>ASP.NET SQL Server Setup Wizard is located (Windows XP and Windows 2008 Server):</p> <blockquote> <p>%WinDir%\Microsoft.NET\Framework\v2.0.50727\aspnet_regsql.exe</p> </blockquote> <p>ASP.NET SQL Server Setup Wizard is located (Windows 7 x64) in one of those:</p> <blockquote> <p>%WinDir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_regsql.exe %WinDir%\ Microsoft.NET\Framework\v4.0.30319\aspnet_regsql.exe %WinDir%\Microsoft.NET\Framework64\v2.0.50727 \aspnet_regsql.exe %WinDir%\Microsoft.NET\Framework\v2.0.50727\aspnet_regsql.exe</p> </blockquote> <p>This self-guided wizard is very simple. You pick your SQL Server (usually .\SQLExpress) and desired database and the wizard will create all required tables and objects to handle ASP.NET security inside your custom SQL database.</p> <p><strong>Step 02 - Generate a Machine Key</strong></p> <p>Passwords inside security tables are store encrypted. You need to generate and record your unique machine key inside web.config file.</p> <p>Visit <a href="http://aspnetresources.com/tools/machineKey" rel="nofollow">http://aspnetresources.com/tools/machineKey</a> and get a ready unique machine key neatly wraped in a few lines of code, ready for your web.config. Generate your lines and place them inside XML element:</p> <pre><code>... &lt;machineKey validationKey="6B6DC7FF0657AEE33FEB36189072D99551F27E281EAEEC8B0516B188A85CF2E4C 4A988429765C625979A232B5BE78D6E52CB59C3675B44FCA032C24B2C49DC5" decryptionKey="CFED70360D049F182EA009258C34ED698A799774A2687AAE94098C71C6BF38C8" validation="SHA1" decryption="AES" /&gt; &lt;/system.web&gt; </code></pre> <p><strong>Step03 - Modify Your web.config</strong></p> <p>Modify your web.config to include membership, roles and profile providers.</p> <p>Place code similar to these lines bellow inside XML element. Replace word "Your" with an appropriate name, matching your naming conventions.</p> <p>...</p> <pre><code>&lt;membership defaultProvider="YourMembershipProvider"&gt; &lt;providers&gt; &lt;add connectionStringName="YourConnectionString" applicationName="/" enablePasswordRetrieval="true" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="true" passwordFormat="Encrypted" maxInvalidPasswordAttempts="5" passwordAttemptWindow="10" minRequiredPasswordLength="5" minRequiredNonalphanumericCharacters="0" name="YourMembershipProvider" type="System.Web.Security.SqlMembershipProvider" /&gt; &lt;/providers&gt; &lt;/membership&gt; &lt;roleManager enabled="true" cacheRolesInCookie="true" cookieName="YOUR_ROLES" defaultProvider="YourRoleProvider"&gt; &lt;providers&gt; &lt;add connectionStringName="YourConnectionString" applicationName="/" name="YourRoleProvider" type="System.Web.Security.SqlRoleProvider" /&gt; &lt;/providers&gt; &lt;/roleManager&gt; &lt;profile defaultProvider="YourProfileProvider"&gt; &lt;providers&gt; &lt;add name="YourProfileProvider" connectionStringName="YourConnectionString" applicationName="/" type="System.Web.Profile.SqlProfileProvider" /&gt; &lt;/providers&gt; &lt;/profile&gt; </code></pre> <p>Now you can run ASP.NET Configuration inside Web Developer or Visual Studio and make sure that all new users are created inside your custom database, and not in /App_Data/ASPNETDB.MDF</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload