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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T22:24:44+00:00 2026-05-29T22:24:44+00:00

I was suggested from a friend the following code var tmp = from allCourses

  • 0

I was suggested from a friend the following code

var tmp = from allCourses in _db.tblCourseNeededHours orderby allCourses.tblCourse.CourseName where allCourses.Semester == semester select allCourses;

return tmp.Sum(x => x.NeededHoursPerWeek);

but i am receving this error

Cannot implicitly convert type ‘double’ to ‘System.Linq.IQueryable

Any idea how to fix it?

enter image description here

public IQueryable FindSumAllCourseNeededHoursInSemester(string semester)

  • 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-29T22:24:45+00:00Added an answer on May 29, 2026 at 10:24 pm

    Chris is correct if you want the complete total, if you want it by course name use GroupBy:

    var hours = FindAllCourseNeededHoursInSemester(mySemester)
        .GroupBy(g => g.CourseName)
        .Select(c => new { c.Key, c.Sum(a => a.NeededHours) } );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a three tier set-up. Someone suggested I should get the ConnectionString from
I am suggested by a friend to use nginx for my site http://www.imgzzz.com .
Hey. I only recently started using Python, and my friend suggested using Twisted as
I'm currently in the process of moving my project from Google Code to Github.
im trying to rewitre from this URL... /Search/VehicleDetails.aspx?vehicle=285584 to this one /VehicleAdvert/tella/Friend/285584 so far
Hi can any one suggest tool for migrating from TFS to TFS preferred Open
Can anyone suggest a good solution to remove duplicates from nested lists if wanting
What algorithm would you suggest to identify how much from 0 to 1 (float)
As the title suggests is it possible to execute another java app from within
As the title suggests, is it correct or valid to import/export static data from

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.