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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T23:49:07+00:00 2026-05-31T23:49:07+00:00

I have a database with a simple flyweight table referenced by another table. Let’s

  • 0

I have a database with a simple flyweight table referenced by another table. Let’s call them, respectively, Category and Product.

The Product table has several columns, one of which is a foreign key column (complete with constraint) to the CategoryID to a row of the Category table. It’s simple, and I have many of them in this particular database.

I am using Linq in Visual Studio 2008 to represent this data in my application. Both tables appear as normal, and neither have anything special in their properties that would indicate the behaviour I’ll describe.

In the database itself, there are several Product rows which have CategoryID=1. There are two or three that have CategoryID=2. However, when the data is loaded into my application through Linq, iterating through context.Products shows that the first three have CategoryID=1, CategoryID=2 and CategoryID=3, and all the rest of the rows have CategoryID=NULL. This is not how it appears in the database. There are no other anomalies in this database.

Help?

edit: I’ve posted an answer below, but maybe the DevExpress guys can chime in? I’m happy it’s now working correctly but I’m not happy that I still don’t understand what went wrong.

  • 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-31T23:49:08+00:00Added an answer on May 31, 2026 at 11:49 pm

    The answer here was twofold:

    1. I regenerated the entire database in the dbml file. This fixed the incorrect data showing up when I iterated through the query, but the data was still coming up incorrectly when I tried to put that data in the grid.

    2. I had created a new column before doing step 1, and the data was showing up incorrectly. After doing step 1, the data in this new column (mapped only to CategoryID) was showing up correctly. However, the data in the original column (mapped to the entity Category) was still behaving as originally described. Once I changed the field from Category to CategoryID the behaviour stopped. I’m still not sure exactly why that happened, but at least for now I have a fix.

    Thanks for your help, @JonSkeet. 🙂

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

Sidebar

Related Questions

I have a simple database table (SQL Server 2008 R2 Express), which has a
I have a simple database table called Entries: class CreateEntries < ActiveRecord::Migration def self.up
I have a simple database with two tables. Users and Configurations. A user has
Ok, i have a simple database engine (its a proprietary product written in vb6)
Let's say I have a simple database with tables 'posts' and 'tags'. Posts can
I have a simple database that has the following relation Each Question has one
I have a very simple database table of posts, I'd like to be able
I have an SQLite database with a simple table of Persons. Each row represents
We have a database with a very simple schema: CREATE TABLE IF NOT EXISTS
I have a simple database structure like this: entries table +----+-----------+------------+-----------+------+ | id |

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.