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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T20:15:14+00:00 2026-05-18T20:15:14+00:00

I have a working sql query that I have been trying to convert to

  • 0

I have a working sql query that I have been trying to convert to linq for the past couple of days. I have read several posts both here and on various site, but have not been successful in any of my attempts to convert this to a working linq query.

The parts that I am specifically having problems with deal with the math (adding individual scores to get the total_score value) and getting the values from the Schools table so I can pass them to my view.

Here is the sql query:

SELECT bowler_name, school_name, bowler_gm1, bowler_gm2, bowler_gm3, bowler_gm4, bowler_gm5, bowler_gm6, (ISNULL([bowler_gm1],0)+ISNULL([bowler_gm2],0)+ISNULL([bowler_gm3],0)+ISNULL([bowler_gm4],0)+ISNULL([bowler_gm5],0)+ISNULL([bowler_gm6],0)) AS total_score 
FROM Bowlers 
JOIN Schools ON Schools.school_id = Bowlers.school_id 
ORDER BY total_score DESC;

Here is as far as I get with the linq query before things start breaking:

from s in db.Schools
join b in db.Bowlers on s.school_id equals b.school_id
select b;

Any help would be much appreciated. 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-18T20:15:15+00:00Added an answer on May 18, 2026 at 8:15 pm

    Something like this should help you on your way.

    from s in db.Schools
    join b in db.Bowlers on s.school_id equals b.school_id
    select new {
      bowler_name = b.bowler_name,
      ...
      totalscore = bowler_gm1 + bowler_gm2 + bowler_gm3 ...
    };
    

    Note it would be much easier to handle nulls if you were to create a BowlerGame table with
    GameID as PK, BowlerID as FK to bowler, GameNumber as game number and finally Score as that game’s score

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

Sidebar

Related Questions

I have a working sql query that I have been trying to convert to
On Sql Server 2008, I have a slow-running update query that has been working
in the past hour i have been trying different variants of this query but
I have been working with SQL Server as a Developer a while. One thing
I have started using Linq to SQL for a project im working on and
I have been working on a java application that has a connection to a
I apologize for this school-book question but I've been working on this SQL query
BACKGROUND I have been working on a tool that is supposed to work in
Hi For many days I have been working on this problem in MySQL, however
I have developed a taxonomy for a site that I've been working on that

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.