Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I've just gone through the process and the steps are as follows. I assume you will be using Entity Framework for data access and have it already set up:</p> <ul> <li>Reference libraries <code>WebMatrix.Data</code> and <code>WebMatrix.WebData</code>. You'll find them under Assemblies/Extensions in the Add Reference dialog</li> <li>Add the following sections into <code>Web.config</code>:</li> </ul> <pre class="lang-xml prettyprint-override"><code>&lt;configSections&gt; &lt;section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" /&gt; &lt;/configSections&gt; &lt;connectionStrings&gt; &lt;add name="DefaultConnection" connectionString="Data Source=(localdb)\v11.0;Initial Catalog=LicenceAudit.mdf;Integrated Security=SSPI;attachDBFilename=|DataDirectory|\LicenceAudit.mdf" providerName="System.Data.SqlClient" /&gt; &lt;/connectionStrings&gt; &lt;entityFramework&gt; &lt;defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework"&gt; &lt;parameters&gt; &lt;parameter value="v11.0" /&gt; &lt;/parameters&gt; &lt;/defaultConnectionFactory&gt; &lt;/entityFramework&gt; &lt;system.web&gt; &lt;membership defaultProvider="simpleMembershipProvider"&gt; &lt;providers&gt; &lt;add name="SimpleMembershipProvider" type="WebMatrix.WebData.SimpleMembershipProvider, WebMatrix.WebData"/&gt; &lt;/providers&gt; &lt;/membership&gt; &lt;roleManager enabled="true" defaultProvider="SimpleRoleProvider"&gt; &lt;providers&gt; &lt;clear/&gt; &lt;add name="SimpleRoleProvider" type="WebMatrix.WebData.SimpleRoleProvider, WebMatrix.WebData"/&gt; &lt;/providers&gt; &lt;/roleManager&gt; &lt;/system.web&gt; </code></pre> <ul> <li>Add <code>WebSecurity.InitializeDatabaseConnection("DefaultConnection", "UsersTableName", "UserId", "UserName", true)</code> to <code>Application_Start()</code> in <code>Global.asax.cs</code></li> <li>Make sure your database file exists and contains the appropriate table. The UserId property should be of type <code>int</code>.</li> <li>Test everything out by executing <code>WebSecurity.CreateUserAndAccount("testUser", "myStrongPassword")</code>. If it passes, you are in the clear.</li> </ul>
    singulars
    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. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    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