Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is mdf file not appearing in the App_Data folder?

I've being trying to get started with Beginning ASP.NET MVC 4.

And hit a problem straight away, according to the e-book I should be able to start a new mvc 4 internet application, debug and select log-in form the UI tempate, then stop. This should create the mdf file in the App_Data folder. Which I should be able to click on and open in Server Explorer.

What actually happens - Database get created in my SQL Express.

Getting this step correct is crucial to following the rest of the tutorial.

I am familiar with MVC , but mainly the front end stuff, so I'm trying to increase my understanding of the database/models side of MVC.

This is a completely new project, no changes were made, just out of the box code. On a windows XP machine, using Visual Studio 2010.

Connectionstring -

  <add name="DefaultConnection" connectionString="Data Source=.\SQLEXPRESS;Initial Catalog=aspnet-HaveYouSeenMe-20131125091100;Integrated Security=SSPI" providerName="System.Data.SqlClient" />

Can anyone please explain - why my out of the box connectionstring is creating the Db in SQL Express and how to create the mdf in the App_Data folder as book suggests. cheers.

like image 259
mkell Avatar asked Feb 06 '14 12:02

mkell


People also ask

Where is my MDF file?

Default Location of MDF File in SQL Server Files that are common and used by all instances on a single system are installed inside the folder :\Program Files\Microsoft SQL Server\nnn\.

How do I view an MDF file?

Since MDF files are SQL server Database files which are basically log files, hence there really is no way to open them. The only way is to attach them. As soon as you attach them, you can see its database in object explorer of SQL Server Management Studio(SSMS).

What is App_Data folder?

The AppData folder includes application settings, files, and data unique to the applications on your Windows PC. The folder is hidden by default in Windows File Explorer and has three hidden sub-folders: Local, LocalLow, and Roaming. You won't use this folder very often, but this is where your important files reside.


1 Answers

I know this says answered, but it may be as simple as clicking the "show all files" icon in the Solution Explorer. By default the .mdf file will not show up, so ensure the "show all files" is selected :)

like image 111
Michael Elliott Avatar answered Nov 15 '22 19:11

Michael Elliott