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
Fares Ayyad
NA
235
74.4k
get the sum of column using Entity framwork
Dec 11 2016 6:51 AM
Hello
i want to implement the following SQL statement using entity framework:
select
coalesce
(
SUM
(cdin_ActMortgageAmnt),0)
from
CRM.dbo.CDIndex,CRM.dbo.company
where
comp_companyid=cdin_companyid
and
comp_idcust
like
'%10319%'
and
cdin_Deleted
is
null
and
cdin_startunstufdate
is
not
null
and
cdin_Status=
'InProgress'
i tried to get the sum of
cdin_ActMortgageAmnt
Company c = db.Companies.Find(750);
var CGP = (from cd
in
db.CDIndexes
join com
in
db.Companies on cd.cdin_CompanyId equals com.Comp_CompanyId
where
com.Comp_IdCust == c.Comp_IdCust &&
cd.cdin_Deleted ==
null
&&
cd.cdin_startunstufdate ==
null
&&
cd.cdin_Status ==
"InProgress"
select
new
{
act=cd.cdin_ActMortgageAmnt
}
);
var query = CGP.Sum(x => x.act);
lblSum.Text = query.ToString();
but the query gives me null while tracing?
Reply
Answers (
3
)
Get the sum of data table column in repeater Footer
I need to login to a specific profile, not the default one