s.handoyo
s.handoyo

Reputation: 11

Making a new database from an existing project in entity framework

I have little experience with entity framework. I have been given an ASP.net web application and it has a database which written in entity frameworks and it runs in the person local computer. I would like to create a new database which contains all of the information (tables, data, etc) inside the database.

i have tried to change the connection string to my localDB but i have no idea on how to create the tables inside my localdb.

i have tried to search for a way but it does not give the answer that i am looking for. Can anybody help me with this problem or maybe someone can direct me to the solution which are already there for my problem?

Thank you

Upvotes: 1

Views: 1221

Answers (1)

Rahul Tagore
Rahul Tagore

Reputation: 101

  • First Change the "Catalog=DBName" in connection string ,

  • then open package manager console type command update-database, press enter. It may help you creating new database.

  • If it will show the error regarding migration.

  • Write command add-migration press enter, then provide a name to the migration.

  • Now again write command update-database and wait for the success message until seed is running.

Upvotes: 1

Related Questions