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

  • SEARCH
  • Home
  • 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 4347180
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T12:16:17+00:00 2026-05-21T12:16:17+00:00

So I’ve run into something and was wondering if you could help me out.

  • 0

So I’ve run into something and was wondering if you could help me out. I am very new (this is my first project in these languages) to MS MVC 2 and Entity Framework 4.0. I’ve drawn up a model using the Model First approach and the graphical designer. I didn’t have a SQL database for it yet and I figured it was just working disconnected, but maybe I just forget that I had specified a connection string somewhere. So I go about my business getting the MVC components up and running using the newly created types from EF. I am attempting to using the Repository pattern as well as Ninject for dependency injection. So I had a lot of time before I had to worry about actual data storage. Which brings me to my issue: I’m now at that point.

I thought it was attaching to a .mdf file and running that off a SQLExpress instance, but I couldn’t really find anything to support that. I didn’t have SSMS installed so I couldn’t figure out how to properly check. Eventually got that up and running and no db. So now I’m confused as to where this is actually wired, if at all. I decided that it’s too weird and want to start over a bit. I generated the SQL script for the Model and create a new db in SSMS to run the script against. Run the script and all is well. Then I go into VS and run a Database First scenario. So the Model now shows all my tables and effectively screws up a few fields by specifying them as keys when they shouldn’t have been. Fixed that up and now I’m back to figuring out the issue that frustrated me in the first place.

I have a User table that has a userId field that is supposed to be a Guid, but during the original modeling I missed it and it was a varchar field. I’ve not been able to fix the mapping underneath it to change the underlying ( not sure the actual terminology for it ) field to a Guid. I changed the Model’s type but nothing updated the database. This has basically put me in an odd position. I believe I’m supposed to allow EF to manage the SQL for me without my involvement, but if this is true how can I push a change like that. Am I restricted to dropping the entire database everytime I need to make a change to the schema?

Sorry if this is the noobest of noob questions, but I am trying to figure all this stuff out and could really use some input. Last language set I used was ASP.Net 2.0 with ADO.Net typed datasets. Am I better off switching to a Code First approach? If I were to do that do I have to start managing the SQL myself again?

I believe this is my first question here so, my apologies if I violated anything; I think I’m clear though.

  • 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-21T12:16:18+00:00Added an answer on May 21, 2026 at 12:16 pm

    Well – EF stores connection string in Web.config file. Your suspicion that EF push you to delete database and create a new one when using model first is partially correct. The good news is that whole this process is driven by a worklfow which can be modified or replaced. You don’t have to do it yourselves. You can download Entity Designer Database Generation Power Pack which contains several new worklfows and templates which allow incremental building of the database via model first approach. This has two disadvantages:

    • You must have either VS 2010 Premium or Ultimate because it uses database features from these editions.
    • Not every change to the model can be processed incrementally. Anything that can lead to losing data will end with exception. I expect that this would be the case when modifying string to Guid. The solution in such case is either modify DB manually or delete it and recreate it from scratch.

    Code first will probably not help you because this approach is currently missing any database evolution but it has fully automated process of recreation the database if model changes.

    Btw. you don’t need SSMS to check the database. SQL server also offers some tools (which must be separately installed) with command line utilities to access the database – osql or sqlcmd. You can also use Server Explorer in Visual Studio Professional and higher.

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
For some reason, after submitting a string like this Jack’s Spindle from a text
I would like to run a str_replace or preg_replace which looks for certain words
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have a French site that I want to parse, but am running into
I want use html5's new tag to play a wav file (currently only supported
We're building an app, our first using Rails 3, and we're having to build

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.