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

  • Home
  • SEARCH
  • 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 8530715
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T09:18:48+00:00 2026-06-11T09:18:48+00:00

I have a view where I store late fees for books not returned on

  • 0

I have a view where I store late fees for books not returned on time, here is how I do it in controller action:

    [HttpPost()]
    public ActionResult DisplayTotalBalance(string id)
    {
        DataContext db = new DataContext();

        var totalLateFee = (from p in db.vwCustomer.Where(a => a.CustomerId == id)
                              group p by p.LateFee into g
                              select g.Key).FirstOrDefault();

        return Json(new { totalLateFee });
    }

Here in vwCustomer where I store late fees, a customer may have many late fees listed. For e.g.

CustomerId LateFee
J101        5.0
P202        6.0
J101        2.0
P203        5.0
J101        5.0

How can I sum all the LateFee for J101 and return in controller action?

  • 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-11T09:18:49+00:00Added an answer on June 11, 2026 at 9:18 am
    (from p in db.vwCustomer.Where(a => a.CustomerId == id) select p.LateFee).sum();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my controller i have an action which does not have a corresponding view.
I have the following view controller in my UIPopover: @protocol StorePopoverDelegate - (void)storeSelected:(NSString *)store;
ok here is the thing i have the view store that shows all the
In an MVC style Ext JS 4 application, assuming I have a single controller/view/store/model
Im create this code to store page view in database, but i have problem
I have an online store. A products page that allows the user to view
I have list view and its adapter stored as global variables. I am not
I have a table containing view/click records. The time is stored in a unix
I have View Controller with a (navigation controller) that can flip between 2 views
I have a UI picker view to store child details, i got the value

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.