Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6952721
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T14:23:08+00:00 2026-05-27T14:23:08+00:00

I am a beginner to using C# and MVC in general and I have

  • 0

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

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T14:23:09+00:00Added an answer on May 27, 2026 at 2:23 pm

    Your connection string is wrong.

    Instead of AttachDbFilename=|DataDirectory|FashionStyle.mdf write Initial Catalog=[DB-NAME], with your database’s name instead of [DB-NAME].

    For further connection string reference, you can check out this site: http://www.connectionstrings.com/sql-server-2008

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a beginner question using pointers in delphi. I create an object and
I am a beginner using S3 and I want to use it to store
I am a beginner in using Blend and WPF in general. I created three
I need to make tutorial for beginner using the R *apply function (without using
I am a beginner of Android apps and am using Eclipse. I have found
Have: Using ASP.NET MVC 2, DataAnnotationsModel based server validation, and client validation with jQuery.
I am a beginner in asp.net MVC. Importing table data using JSON, on column
I have started developing a full-web application by using the ASP .NET MVC 3
I am just a beginner of ASP.NET MVC. I have done some page by
I'm just a beginner about ASP.NET MVC. Thought it doesn't have any problems in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.