Modify an ASP.NET Login Database

In my test environment, I created Login and used the ASP.NET configuration in Visual Studio. It worked great. But now, after testing, I imported the existing database into my sql server, and this database contains the existing asp.net login tables (same structure). In my web application, I want to use these imported tables, not the ones that are in my test database. I already checked web.config as well as the aspnetreg tool (don't know the exact name: p)

My question is: how can I change the database used by my ASP.NET login?

+3
source share
1 answer

, DB

web.config

        <add name="ApplicationServices" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true" providerName="System.Data.SqlClient"/>

, , , web.config

<membership>
        <providers>
            <clear/>
            <add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" connectionStringName="ApplicationServices" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" passwordFormat="Hashed" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" passwordStrengthRegularExpression="" applicationName="/"/>
        </providers>
    </membership>

connectionStringName .

EDIT

<roleManager enabled="true">
        <providers>
            <clear/>
            <add connectionStringName="ApplicationServices" applicationName="/" name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
        </providers>
    </roleManager>

connectionStringName .

+4

Source: https://habr.com/ru/post/1761704/


All Articles