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

  • SEARCH
  • Home
  • 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 8458981
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T13:13:28+00:00 2026-06-10T13:13:28+00:00

Going through the Tutorial v2.0, I’ve just added data access to the sdf database.

  • 0

Going through the Tutorial v2.0, I’ve just added data access to the sdf database. When I click on the Stores link after running the app, I get an ArgumentNullException on the following line in my StoreController:

var genres = storeDB.Genres.ToList();

In the watch window, I’m seeing that the StoreDB is not null, but the Albums & Genres are null. At first I thought this was a connection string issue, but I’ve pulled the database from the completed code file along with the connection string. Running the complete solution works fine, but mine fails as described above. I’m not seeing any differences in the code I entered. In fact, most of what I entered was copied and pasted.

How do I zero in on what the actual problem is?

  • 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-06-10T13:13:29+00:00Added an answer on June 10, 2026 at 1:13 pm

    The class MusicStoreEntities was not inheriting from DbContext. IOW, I had left off :DbContext from the class definition and did not notice it:

    public class MusicStoreEntities: DbContext
    {
        public DbSet<Album> Albums { get; set; }
        public DbSet<Genre> Genres { get; set; }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am just getting into xslt transformation and after going through a tutorial I
I just downloaded MVC and I am going through a tutorial. Everything goes fine
I am going through Music Store tutorial (ASP.NET 3/Razor). After I have created the
$info['schedule'] = array('swimming', 'soccer', 'read book'); Just going through a tutorial and came across
I am just going through a tutorial and the instructor seemed to gloss over
I was just going through some tutorial on responsive web design or fluid layouts.
I am just starting out going through a tutorial on scala and have hit
After signing up for Git and going through the tutorial, I ended up Forking
Just going through a tutorial, and thought somewhere I saw first_name: And another place
I am going through this tutorial , but I already had Ruby 1.8.7 installed.

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.