Question

Every time I configere a seperate database on the management studio for the Asp.net membership a default ASPNETDB.MDF creates in the project. When i use the AddUser and AddRoles feature, it goes to the default database in the project instead of the allocated one in the management studio. This is my connection string:

<connectionStrings>

    <add name="office" connectionString="Data Source=DELL-PC;Initial Catalog=LoginDB;Integrated Security=True" providerName="System.Data.SqlClient" />
  </connectionStrings>
  <system.web>
    <!--Membership Provider config Start-->
    <membership>
      <providers>
        <clear/>
        <add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="office"   enablePasswordRetrieval="false"   enablePasswordReset="true"  requiresQuestionAndAnswer="false" requiresUniqueEmail="false"    minRequiredPasswordLength="1" minRequiredNonalphanumericCharacters="0"  passwordFormat="Hashed"     maxInvalidPasswordAttempts="5" passwordAttemptWindow="10"     passwordStrengthRegularExpression="" />
      </providers>
    </membership>
    <profile>
      <providers>
        <clear/>
        <add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="office" applicationName="Test_DavidSilva"/>
      </providers>
    </profile>
    <roleManager enabled="true"></roleManager>
    <!--Config Finish-->
Was it helpful?

Solution

Most of your configuration is saved in ASPNETDB.MDF database. You need to create one from outside as shown in the below link

http://weblogs.asp.net/scottgu/archive/2005/08/25/423703.aspx

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top