I would like to know where to name my database inside a connection string, like this one:
<connectionStrings>
<add name="DefaultConnection" connectionString="Data Source=(LocalDb)\v11.0;AttachDbFilename=|DataDirectory|\MyDatabase.mdf;Initial Catalog=MyDatabase;Integrated Security=True" providerName="System.Data.SqlClient" />
</connectionStrings>
For what I've reading, the name should be placed next to |DataDirectory|
, but the fact is that I've deleted the App_Data
folder, because I don't want to have a folder with such a name in my project, so the file .mdf
won't be create, and I neither want to be.
What I want is that when going to the Server Explorer
view inside Visual Studio Express 2013 for Web I could see the database with the name I've selected above, whichever it is.
ADDITIONAL:
- I would like to know what are the pros/cons of not having an
App_Data
folder.
Thank you for your help.