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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T14:30:35+00:00 2026-05-26T14:30:35+00:00

I have three tables A, B, C. A having Id,Name,Address coulmns. B is the

  • 0

I have three tables A, B, C. A having Id,Name,Address coulmns. B is the generic table having attributeID,aId, attributeName. where as c is the details table for B. with columns valueId, attributeId, aId Value.
Scenario is. suppose A is the Specific entity table (say Student). only containing the basic columns and values. where as B is there for additional columns for Entity student. (ex, student may have changed address, may have 3 mobile numbers)

    Table: A
    Aid      Name                   Address1 
    std1     Student                MG Street
    std2     Employee               Royal Street

    Table : B
    attributeId    aID            Value
    att1           std1          Address2
    att2           std1          ChangedAddress   
    att3           std1          Mobile1
    att4           std1          Mobile2

Table :C
 ValueId  attributeId    aID            Value

val1      att1           std1          Stefen colony  
val2      att2           std1          ChangedTo:Laurds
val3      att3           std1          87879797979798
val4      att4           std1          544559797979798


Note :Same for Employee 

I want to build the query to get the all the valuefrom c for std1 with values in table A. But somehow db stucture is dynamic, in the sence the coulmns for the table A stored as values in table B, where as Values for B attributes stored in Table C. How to write Linq query for this?

  • 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-26T14:30:36+00:00Added an answer on May 26, 2026 at 2:30 pm

    You can simply join the records together like:

    class Student
    {
        public int Id { get;set;}
    }
    
    class StudentPropertyDefintion
    {
        public int Id { get; set; }
        public int StudentId { get; set; }
        public string PropertyName { get; set; }
    }
    
    class StudentPropertyValue
    {
        public int PropertyDefinitionId { get; set; }
        public string PropertyValue { get; set; }
    }
    
    class Context
    {
        public ISet<Student> Students { get; set; }
        public ISet<StudentPropertyDefintion> PropertyDefinitions { get; set; }
        public ISet<StudentPropertyValue> PropertyValues { get; set; }
    }
    
    // and query that
    
      Context context = new Context();
    
            var studentWithPropertiesQuery = from student in context.Students
                                             join propertyDefinition in context.PropertyDefinitions
                                             on student.Id equals propertyDefinition.StudentId
                                             join propertyValue in context.PropertyValues
                                             on propertyDefinition.Id equals propertyValue.PropertyDefinitionId
                                             select new
                                             {
                                                 propertyValue,
                                                 propertyDefinition,
                                                 student
                                             };
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Table having the following column: ID, Name, Designation, Salary, Contact, Address,
I have three tables, 1-Users, 2-Softwares, 3-UserSoftwares. if suppose, Users table having 6 user
I'm having some trouble using constraints correctly. I have three tables, 'item', 'store' and
I have three tables of data: table: cars [10,000 rows] table: planes [2,000 rows]
I have three tables Author, Book and AuthorBook. AuthorBook table only contains two foreign
I have three tables in oracle db as newitems, itemdetails, ticketitems table. Some dummy
It's simple. I have three tables, for example: Persons(ID, Name, etc.) Lessons(ID, ClassroomID, Description,
I have these three tables: Table 1 : InvoiceId InvoiceNumber CompanyId ------------------------------------------------- 3 1
Im having a hard time building the triple join query. I have three tables:
I have three tables in my database: Products id (int, primary key) name (varchar)

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.