Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Mysterious database

Posted on 2011-09-09
4
Medium Priority
?
236 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
  • 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 2000 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Hello there! As a developer I have modified and refactored the unit tests which was written by fellow developers in the past. On the course, I have gone through various misconceptions and technical challenges when it comes to implementation. I would…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…

886 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