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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T06:30:44+00:00 2026-05-13T06:30:44+00:00

I am looking for a more efficient way to do this…(see below)… I have

  • 0

I am looking for a more efficient way to do this…(see below)… I have to perform it seven times as I have seven feature articles. The id I am feeding off is the page id (aka featurearticles.fk_pageID_item1 featurearticles.fk_pageID_item2).

I am ok with doing a table join and not selecting * as it were. I am also ok with making a temporary object to hold information.

DataAccess.Page pgf1 = (from p in db.Pages
where p.pageID == featurearticles.fk_pageID_item1
select p).FirstOrDefault();

PageArticle paf1 =(from pa in db.PageArticles
where pa.page_art_pageID == pgf1.pageID &&
pa.page_art_isCurrent ==true
select pa).FirstOrDefault();

Article af1 = (from a in db.Articles
where a.articleID == paf1.page_art_articleID
select a).FirstOrDefault();
  1. gets a page.
  2. gets the current version.
  3. gets the info for that version.

I am stuck with this table layout.

Thanks.

  • 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-13T06:30:44+00:00Added an answer on May 13, 2026 at 6:30 am

    Most of the credit for this goes to astander.

    Article af1 = (from p in db.Pages
                   join pa in db.PageArticles on p.pageID equals pa.page_art_pageID
                   join a in db.Articles on pa.page_art_articleID equals a.articleID
                   where p.pageID == featurearticles.fk_pageID_item1
                   && pa.page_art_isCurrent == true
                   select a).FirstOrDefault();
    

    You should be able to use this query as a drop in replacement for what you already have.

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

Sidebar

Related Questions

Greetings all, I'm looking for a more efficient way to grab multiple users without
I am looking for a more sophisticated way of using Linq to SQL. I
I am looking for a more elegant way of concatenating strings in Ruby. I
I'm looking for more and better documentation about snapshots, flow repositories, and flow state
I am looking for a more technical explanation than the OS calls the function.
I realize you can script Microsoft Office apps, but I'm looking for something more
Looking at MVC framework, it seems we require more of classic ASP knowledge then
I am looking for one or more resources on best practices for c# codegen
I'm looking to replace a couple of machines in the office with a more
I'm looking to make validation for a page in which one or more fields

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.