Solved

Mysterious database

Posted on 2011-09-09
4
226 Views
Last Modified: 2012-06-27
Hi All,
 

I am using MVC3 with I had a  few databse tables already and I generated classes out of that. Now when I create controller out of that and try to add new records then it does create them but all those records don't even show up in the .MDF file which is there. But it saves them all somewhere else. I am not even able to figure out where does it store them. Even web.config has reference to only one databse and that is the MDF file that I am reffereing to . I am not sure where is this parallel databse coming from..

Is there anything that I am doing wrong?
.
0
Comment
Question by:TheCommunicator
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 9

Expert Comment

by:Grant Spiteri
ID: 36515930
Have to done a search for the database ie mydb.MDF on your comp to see if a duplicate comes up?
0
 

Author Comment

by:TheCommunicator
ID: 36516300
yeah, it shows only one entry
0
 
LVL 12

Accepted Solution

by:
Wouter Boevink earned 500 total points
ID: 36516409
Did you initialize your model with a connection string?
By default mvc3 looks for a conectionstring in the web.config with the same name as the model name.
If no connectionstring is found MVC3/EF4 creates a database for you, with a .sdf extension (not sure about the extension though).
0
 

Author Comment

by:TheCommunicator
ID: 36525060
Well, little correction here. By default, it looks for a connection string in the databse with the DBContext's name not the model name. Yes, that's where I was mistaken bacause it had created a DBContext class but I did not name my connection string with something that matches it.

As a result it created an MDF file with the same name and started operating from it. It was a nighmare. Thanks anyways.:).
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question