theChampion
theChampion

Reputation: 4457

ASP.Net MVC Microsoft Integrated User Database

ASP.Net Mvc automatically generate User Database when you create internet project. I want the tables from this database to be created automatically again but on my database. How can be done this ?

I think this database is automatically created on

<add name="DefaultConnection" connectionString="Data Source=(LocalDb)\v11.0;Initial Catalog=aspnet-AccountPortal-20131128183241;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnet-AccountPortal-20131128183241.mdf" providerName="System.Data.SqlClient" />

I want to be created on my connection string. So I can be able to see the tables.

Upvotes: 0

Views: 128

Answers (1)

Imran
Imran

Reputation: 504

Change

public class UsersContext : DbContext
{
    public UsersContext()
        : base("DefaultConnection") //<--- change it to your connectionstringname
    {
    }

    public DbSet<UserProfile> UserProfiles { get; set; }
}

change DefaultConnetion to the connection string name that you want these tables to be created.

Upvotes: 2

Related Questions