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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T08:01:51+00:00 2026-05-11T08:01:51+00:00

I must have missed something in my LINQ training. In Linq to SQL using

  • 0

I must have missed something in my LINQ training. In Linq to SQL using c#, I want to query two tables, one with the foreign key to the other, and pass two parameters, one for each table.

IN SQL, it is something simple like

Select Value from Table1 T1  INNER JOIN Table2 T2 On T1.DefID = T2.ID Where T1.PollID = 1  AND T2.Name = 'Question' 

in LINQ, I get stuck!

var q = from t1 in dc.Table1         join t2 in dc.Table2         on t1.DefID equals t2.ID         into newGroup         where t1.PollID == 1   // here's where I get stuck!         // how do I query t2?         select newGroup; 

Is my approach wrong? Thanks in advance.

  • 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. 2026-05-11T08:01:52+00:00Added an answer on May 11, 2026 at 8:01 am
    var q = from t1 in dc.Table1     join t2 in dc.Table2     on t1.DefID equals t2.ID     where t1.PollID == 1 &&     t2.Name == 'Question'     select new {         Alias1 = t1.FieldName,         Alias2 = t2.FieldName     }; 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here's another one of these LinqToSQL questions where I'm sure I must have missed
I must have missed something regarding generics in Java, but why does this not
I must have missed something obvious, but how do you create a scala-tuple in
I must have missed something here. I am trying to create a table but
You must have noticed one link in yahoo.com, msn.com or other popular websites named
I must have overlooked something completely obvious?? but my button displays its image and
I must have done something wrong. I have a C# project in Visual Studio
I'd like to get with LINQ an employee list, these employees must have in
I must have pressed on the wrong button at some point, and now when
I must have a little design in javascript. I have a menu with 5

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.