I simply began using C# and MVC3, and I have been following a MVCMusicStore tutorial at ASP.NET website.. Within the tutorial it used
<add name="MusicStoreEntities" connectionString="Data Source=|DataDirectory|MvcMusicStore.sdf" providerName="System.Data.SqlServerCe.4.0"/>
because the connection string... During my application I transformed it to
<add name="FashionStyle.StoreEntities" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|FashionStyle.StoreEntities.mdf;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient"/>
However I discovered the particular database file is within
C:\Program Files\Microsoft SQL Server\MSSQL10.SQLEXPRESS\MSSQL\DATA
My real question is how do you move it after that towards the Application_Data folder within the project making it to ensure that Visual Studio 2010 knows where you can search for the database file? The reason being the applying is really a group work and I wish to share it with my team people.
really what they've used is
.sdf file ie.,
Sql Server Compact Database file and what you're using is
.mdf file the industry
Sql Server Database file.
now for those who have produced that database through either Versus Server Explorer or
Sql Server Management Studio i quickly think you do not have to fret, only use
<add name="FashionStyle.StoreEntities" connectionString="Data Source=.\SQLEXPRESS; Initial Catalog=yourDatabase; Integrated Security=True; User Instance=True"; providerName="System.Data.SqlClient"/>
Visual Studio is only going to know how to locate it should you tell it how to locate it. Simply backup the database using standard SQL Server methods and restore it where's most suitable then improve your appconfig/webconfig + Server Explorer to suggest into it.