0

I have built my MVC 5 project based on entity framework Database First approach by following video tutorials. But what I have obtained is the model. There is nothing in the app_data folder. I want to obtain the .mdf file as well so that I can deploy the database to the azure.

Note: I'm using the server explorer database in VS2013.

1 Answer 1

1

I dont think you will be getting any .mdf files on app_data folder. To deploy your database to Azure:

  1. Right click your database on SQL server, then Tasks->Generate Scripts. On scripting options, select sql azure server

enter image description here

  1. Login to your azure account and create a SQL server and run generated script from the portal by clicking the link below:

enter image description here

  1. while creating your EF connection, use the connection string for your Azure Database like: enter image description here

    At the end you should be ready to use your ORM.

Sign up to request clarification or add additional context in comments.

3 Comments

How do I generate scripts again please?notice im using the server explorer on VS2013.My database is there.if I right click on it I don't have tasks-->generate scripts
Ok, on your server explorer right click to your Data Connection and select "Browse in sql server object explorer". On the new window, select your database to export the model, riht click and select "Extract data-tier application". Rest is simple. extract the generated file and your sql script is inside model.sql
select your database to export the model??can't see mydatabase

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.