简体   繁体   English

ASP.Net成员不访问我的Sql Server数据库

[英]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. 我在我想要存储成员资格表的数据库上运行aspnet_regsql。它是我存储工作负载的所有表的相同数据库。

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. 但是,当我在我的网站上注册用户时,它会在表ASPNETDB中创建用户,而不是我在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. 您必须在system.web标记下的web.config中指定成员资格提供程序。 Check 校验

this link fro reference. 这个链接来自参考。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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