Entity Framework Sum Method -
var resultlist = new datatable(); sqlconnection connection = new sqlconnection(@"server=. ; database=personneltrackingsystem;trusted_connection=yes"); connection.open(); sqldataadapter da = new sqldataadapter(@"select sum(takepay) [personneltrackingsystem].[dbo].[personnelsallaries] ", connection); da.fill(resultlist); return resultlist;
this sql code sum of integer take pay variables. how can change them entity framework ? tried doesn't work
personneltrackingsystementities entity = new personneltrackingsystementities(); return (entity.personnelsallaries.sum(d => d.takepay)).tostring().tolist();
Comments
Post a Comment