2014-10-31 75 views

回答

0
Hi Mahaveer, 

You will have to do following changes in connection string and system.web: 

The UserManagement_Connection is basically a connection string 
<add name="UserManagement_Connection" connectionString="Data Source=.\SQLExpress;Initial Catalog=ASPNETDB;Integrated Security=false;User Id=userId;Password=pwd" providerName="System.Data.SqlClient" /> 


<system.web> 
    <membership defaultProvider="SqlProvider" userIsOnlineTimeWindow="15"> 
     <providers> 
     <clear /> 
     <add name="SqlProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="UserManagement_Connection" applicationName="myapplication" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" passwordFormat="Hashed" /> 
     </providers> 
    </membership> 
    <roleManager enabled="true" defaultProvider="RoleProvider"> 
     <providers> 
     <add connectionStringName="UserManagement_Connection" applicationName="myapplication" name="RoleProvider" type="System.Web.Security.SqlRoleProvider, System.Web,     Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> 
     </providers> 
    </roleManager> 


Then directly you can use the Membership functions in your application 

Let me know if you face any issue. 

:) 
+0

感謝您的迴應,但我只使用asp.net身份表來管理用戶,所以我已經在identity.but mvc論壇用戶數據使用成員資格表中遷移成員表。 – 2014-11-03 13:04:53