0

I have used this link to add first name and last name. Now I'm seeing an error Cannot drop database "dbname" because it is currently in use.. I don't want to drop my Database, just want to add first name and last name in register of asp.net identity user in mvc5. give me suggestions..

  • It'll be better if you add code to your question. – SᴇM Oct 06 '17 at 06:41
  • Sem, see the link, I have provided, I have followed the same, just to add first name and last name property – Azhar Shahzad Oct 06 '17 at 06:43
  • this should not happen. add some code. the structure of your ASPNET users table will help with solving the problem – Sujit.Warrier Oct 06 '17 at 06:55
  • 2
    Possible duplicate of [How can I add user First Name and Last Name to an ASP.NET Identity 2?](https://stackoverflow.com/questions/23209539/how-can-i-add-user-first-name-and-last-name-to-an-asp-net-identity-2) –  Oct 06 '17 at 07:01
  • @TAHATEMURII I have followed this, because of this implementation, I'm facing this issue – Azhar Shahzad Oct 06 '17 at 07:09

1 Answers1

0

DropCreateDatabaseAlways I was using this option. After changing to

Database.SetInitializer<ApplicationDbContext>(new 
    MigrateDatabaseToLatestVersion<ApplicationDbContext, 
    APPLICATION.Migrations.Configuration>());

This works fine, also I need to enable migration using package manager console

Enable-Migrations
Add-Migration "FirststName"
Add-Migration "LastName"

Thanks @Archana Parmar