0

I'm using in a MVC4 internet app the new SimpleMemebership provider with Entity Framework code first. Evrything is fine except that the framework creates the new database with named "DefaultConnection" even if I changed it.

<add name="MyDB" connectionString="Data Source=.\SQLEXPRESS; Initial Catalog=BeerOperator; Integrated Security=SSPI; MultipleActiveResultSets=True" providerName="System.Data.SqlClient" />

and in Filters\InitializeSimpleMembershipAttribute.cs

WebSecurity.InitializeDatabaseConnection("MyDB", "UserProfile", "UserId", "UserName", autoCreateTables: true);

I really don't understand what I need to change in order to have the User management table created into MyDB database.

Many thanks davide

Davide
  • 1,305
  • 3
  • 16
  • 36

1 Answers1

0

Nevermind, I found it. In the AccountModel.cs I had:

public UsersContext() : base("DefaultConnection")

I changed into:

    public UsersContext() : base("MyDB")

and now is ok.

Davide
  • 1,305
  • 3
  • 16
  • 36