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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T08:45:38+00:00 2026-06-14T08:45:38+00:00

EDITED: I am retrieving some order data and am trying to grab the product

  • 0

EDITED: I am retrieving some order data and am trying to grab the product description from another table using the productID from the first table. The code below works fine but I need to query the products table using the productid to get the string,product description

 Dim result = From c In ctx.orders
                         Where c.CustomerId = 13
                Select New With
                {c.OrderDate,
                 c.PurchaseOrderNumber,
                 c.ProductId,
                 c.ProductPrice,
                 c.ProductQty}

I tried the suggestions below and get a “field or property named productid doesnt exist” error
using this method

 Dim result = From c In ctx.orders
                         Where c.CustomerId = 13
                  Join prod In ctx.products on c.ProductId Equals prod.Id
                Select New With
                {c.OrderDate,
                 c.PurchaseOrderNumber,
                 prod.Description,
                 c.ProductPrice,
                 c.ProductQty}
  • 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-14T08:45:39+00:00Added an answer on June 14, 2026 at 8:45 am

    Why not use the join operator C# version and join operator VB version

    Dim result = From c In ctx.orders
                 Join prod In ctx.products On c.ProductId Equals prod.Id
                 Where c.CustomerId = custid
                 Select New With
                        {c.OrderDate,
                          prod.Description
                         c.ProductPrice,
                         c.ProductQty}
    

    I made a sample class to test the join and this worked perfectly. Are you sure it loaded the products tables and it has the property?

    Module Module1
    
    Sub Main()
        Dim ctx As List(Of X) = New List(Of X)
        Dim x1 As X = New X()
        x1.One = 1
        x1.Two = 2
        Dim x2 As X = New X()
        x2.One = 10
        x2.Two = 20
        ctx.Add(x1)
        ctx.Add(x2)
    
        Dim ctx2 As List(Of Y) = New List(Of Y)
        Dim y1 As Y = New Y()
        y1.Three = 1
        y1.Four = 2
        Dim y2 As Y = New Y()
        y2.Three = 10
        y2.Four = 20
        ctx2.Add(y1)
        ctx2.Add(y2)
    
        Dim result = From c In ctx
             Join prod In ctx2 On c.One Equals prod.Three
             Where c.One = 1
             Select New With
                    {c.One,
                     prod.Four,
                     c.Two}
    
        For Each a In result
            Console.Beep()
        Next
    
        Console.Read()
    End Sub
    
    Class X
        Public Property One As Integer
        Public Property Two As Integer
    End Class
    
    Class Y
        Public Property Three As Integer
        Public Property Four As Integer
    End Class
    
    End Module
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Edited version with working code: Table schema: category (catid, catname) product (productid, catid, productname)
Edited Question: Trying to use a .dll file from Java using JNA. I've managed
Edited at the request of commenters. I hope this is compliant. First post! Trying
I'm retrieving information about resources from a MySQL database using PHP. The information about
Edited after initial suggestions about using IEnumerable instead of List. I am trying to
(Edited for clarification) My (non-OSGi) application build is in Gradle, and I am trying
EDITED I'm using Twitter Bootstrap and need to move navbar right( not float:right, but
Edited Question: This should be clear. using System; namespace UpdateDateTimeFields { class Program {
(Edited a lot) I've got some classes with Abstracts Members. The concrete type of
EDITED to show real example How can I call a generic function from a

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.