Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

var giving "Cannot assign a method group to an implicitly typed" error

Status
Not open for further replies.

sirnose1

Programmer
Nov 1, 2005
133
US
I am trying to write some linq code to sum numbers from column in a table with a between statement. Query looks good but I am getting an error "Cannot assign a method group to an implicitly typed local variable". The code is as follows:


public int GetDelithMinBetween(int unitID, DateTime currSampleTime, DateTime prevSampleTime)
{
DataDelithiationDataContext ddc = new DataDelithiationDataContext();

var prevDelithMinutes = (from pd in ddc.tblDelithiations
where (unitID.ToString() == pd.unitID.ToString()) && (pd.startTime <= currSampleTime && pd.endTime >= prevSampleTime)
select pd.delithMinutes).Sum;

return prevDelithMinutes;

}

Any help would be appreciated. Thanks.
 
.Sum(); not .Sum;

Jason Meckley
Programmer
Specialty Bakers, Inc.

faq855-7190
faq732-7259
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top