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 6916259
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T09:34:44+00:00 2026-05-27T09:34:44+00:00

Using Entity Framework 4.1 with SQL Server 2008 R2 Express. I have a strongly

  • 0

Using Entity Framework 4.1 with SQL Server 2008 R2 Express.

I have a strongly typed DbContext (ctx in code) with IDbSet<Users> property which represents a table [Users] in the database.
When I execute:

var result = ctx.Users.ToList();

The result.Count is 0 as if there is nothing in the database although there are records in that table. I’ve checked the ctx.Database.Connection and it does have the right connection string.

I executed

ctx.Users.ToString()

to get the SQL that will be executed and when I execute the given statement in the SQL management studio I do get the list of users.

It seems as if the query is never executed and I am unable to detemine what could be the problem.

  • 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-27T09:34:45+00:00Added an answer on May 27, 2026 at 9:34 am

    Everything is fine. It did not read the correct connection string and it created an empty database instead :). Thx everybody for the effort

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

Sidebar

Related Questions

I am using C#, Entity Framework and SQL Server 2008 Express. I am connected
I am using the Entity Framework with SQL Server Express 2008. When using the
I have an MVC app using Entity Framework and a SQL Server 2008 database.
I'm trying to setup the Entity Framework with SQL Server 2008. I'm using Guids
I am using MVC (C#) and the Entity Framework. I have a sql server
I have an application developed in ASP.NET MVC using Entity Framework / Sql Server
Using Entity Framework 4 with stored procedures and SQL Server 2008 SP1... When running
I'm using Entity Framework and MS SQL Server 2008. It seems that Entity Framework
I am using Entity Framework to layer on my SQL Server 2008 database. The
I am using Entity Framework 4.0, C# 4.0, .Net 2010 and SQL Server 2008

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.