I am a beginner to using C# and MVC in general and I have been following the MVC Music Store tutorial because my assignment question is similar to the tutorial (it's a store). However, I am experiencing a problem. I need to use SQL Server Express for the database instead of SQL Server Compact.
I changed the connection string and when it compiles it does not work..
<add name="FashionStyle" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|FashionStyle.mdf;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient"/>
In my StoreController:
public ActionResult Index()
{
var types = storeDB.Types.ToList();
return View(types);
}
View:
<h3>Browse Type of Product</h3>
<p>
Select from @Model.Count() type:</p>
<ul>
@foreach (var type in Model)
{
<li>@Html.ActionLink(type.Name, "Browse", new { type = type.Name })</li>
}
</ul>
Also, when I run and navigate to the store page, "Browse Type of Product Select from 0 type:" shows up. I also used a modified sampledata.cs from the tutorial
it does not workmean?