Dec 24, 2012 at 4:59 AM
Edited Dec 24, 2012 at 5:04 AM
Let me show my situation and thanks for your help.
I have install SQL Server 2008 express on my computer. But I have recognized that this tutorial is using SQL Server Compact Edition.
So I used the following configuration in web.config file
<add name="MusicStoreEntities" connectionString="|DataDirectory|MvcMusicStore.mdf" providerName="System.Data.SqlClient" />
Unfortunatly, I got the exception at runtime below(Other code snippets is the same as the tutorial)
public ActionResult Index()
var genres = storeDB.Genres.ToList(); //This line occurs
ArgumentException was unhandled by user code.
Format of the initialization string does not conform to specification starting at index 0.
So how could I configure the web.config file to make it work? Thank you for all!
Do I need to add a MvcMusciStore.mdf file before these operations?