简体   繁体   中英

ASP.Net Membership not accessing my Sql Server Database

I ran aspnet_regsql on my database where i want to store the membership tables in. It's the same database i store all the tables for my workload.

However when i register a user on my site, it creates the user in a table ASPNETDB rather than the one i created in Sql server.

<?xml version="1.0"?>
<!--
  For more information on how to configure your ASP.NET application, please visit
  http://go.microsoft.com/fwlink/?LinkId=169433
  -->
<configuration>
  <connectionStrings>
    <add name="HotelProjectConnectionString" connectionString="Data Source=KHAN-PC;Initial Catalog=HotelProject;Integrated Security=True"
      providerName="System.Data.SqlClient" />
  </connectionStrings>

  <system.web>
    <roleManager enabled="true" />
    <compilation debug="true" targetFramework="4.0">
      <assemblies>
        <add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
        <add assembly="System.Web.Extensions.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
        <add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
      </assemblies>
    </compilation>
  </system.web>
</configuration>

You must specify Membership provider in you web.config under system.web tag. Check

this link fro reference.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM