When creating a new database with SQL Server Express 2005, the database files (.mdf and .ldf) are saved by default to C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data .
However, with the tutorials I've seen for ASP.NET MVC (like Nerd Dinner), it seems common practice to store database files in the App_Data folder of an ASP.NET project.
Questions
- Is there any value for the App_Data folder, or is it just a convenient place to store database files if you use the Visual Studio constructor to create a new database?
- Will there be any negative consequences if I do not use or even delete the App_Data folder?
Update
One thing I still don't get. If the server has a production database, why do you want to replace this database with what is in App_Data. Wouldn't you usually want to have update scripts that you run in the production database when you release a new version of the application? Even for initial deployment, I would rather create a database script than a physical copy of the files. In addition, when using SQL Server (Express) databases, copying is not enough. You must separate the database to manipulate the files, and then reconnect when you are done.
So, I have to say that the App_Data point is still eluding me. Can someone enlighten me?
source share