I have a column requestAmount
that is nvarchar(100)
.
I need to calculate sum :
int? sum = q.Sum(g => g.requestAmount);
I got this error:
Error 26 Cannot convert lambda expression to delegate type '
System.Func<samtaApplication.DbLayer.tblMaterial,int>
' because some of the return types in the block are not implicitly convertible to the delegate return type
How can I convert string to int?