TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
asif tariq
NA
148
17.2k
Linq Query in asp.net mvc
Jan 14 2020 8:46 PM
public ActionResult CommulativeCAmount()
{
MPOWERINGDBContext db = new MPOWERINGDBContext();
DateTime twelveMonthsBeforeNow = DateTime.Now.AddMonths(-12);
var comid = Convert.ToInt32(Session["MyId"]);
var query = db.Cases.Where(x => x.CompanyID == comid).Where(x => x.ReceievedDate >= twelveMonthsBeforeNow)
.GroupBy(p => new { p.ReceievedDate.Value.Month,p.ReceievedDate.Value.Year })
.OrderBy(x=>x.Key.Year)
.Select(g => new {
mymonth = (string)g.Key.Month.ToString(),
myAmount = (double)g.Sum(w => w.TotalCollection),
}).ToList();
return Json(query, JsonRequestBehavior.AllowGet);
}
i want to store commulative sumamount in myAmount using linq query above is my linq query data show correct but i want to show commulative amount?
Reply
Answers (
0
)
An exception of type ‘System.Web.HttpException’ occurred in
unable to add area.