Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5936115
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T15:21:11+00:00 2026-05-22T15:21:11+00:00

I have been trying to follow the few tutorials on how to create a

  • 0

I have been trying to follow the few tutorials on how to create a DB using the model first approach in MVC. I have gone as far as creating Entities in the designer and trying to generate a DB from the model. It creates SQL file fine but I cant seem to execute it? I have no option to do so? When I right click the file the execute option is not available and when I open the file and right click in the context the option is not available. I have tried connecting to a blank DB and then creating the Entity Model on this DB with model entities and then trying to generate a DB from the model but still no option to execute the sql from within VS2010 express.
Is there a reason why its not there ?

Question 2
I like using the model first approach as I find the graphical representation of all the entities and their relationships easy to understand and I like the fact all the C# Db access classes get created at a click of a button. However most examples for MVC 3 seem to use the code first approach. are there big benefits in using code first over model first? which approach is easier to grasp ? I come from DB background and when i did do some asp coding way back, DBs were always in place first 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T15:21:12+00:00Added an answer on May 22, 2026 at 3:21 pm

    i watched model first tutorials and i couldn’t right click and execute the sql generated from the entity data model. I found an answer online. I had to (1) remove the keyword “GO” from throughout the sql file, then (2) remove the line at the top that says “USE … blah blah”, then (3) right click on the database mdf in the database explorer window and click “new query” (4) replace the words “select from blah blah” in the new query window with my revised sql code. (5) when I right clicked in the new query window, NOW I had the option to execute sql. It gave a warning but then said it completed successfully (and it worked just like in the video after all of that). There is a better walkthrough with pictures in the article I found http://www.telnet80.com/2010/09/fixing-entity-framework-model-first-sql.html

    Model first is way cooler than code first in my opinion, but only if there ends up being an easy way for beginners like me to re-seed the data when they end up tweaking the data model and regenerating the database. The only examples I’ve seen are code first.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been trying to implement Win32's MessageBox using GTK. The app uses SDL/OpenGL,
I have been trying to make a case for using Python at my work.
I have been trying to follow some WCF Data Services examples and have the
I'm working on my first real MVC application and I'm trying to follow general
I have been racking my brain for a few days trying to get a
I have been trying to follow this example (download the source code from a
I have been trying to follow the example in this post . Since I
I have been trying to find a really fast way to parse yyyy-mm-dd [hh:mm:ss]
I have been trying to determine a best case solution for registering a COM
I have been trying to work my way through Project Euler, and have noticed

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.