Sorry for this simple question .
I have a Stored Procedure that return an int value , I'm trying to call this sp from my asp.net linq to sql project .
int currentRating = db.sproc_GetAverageByPageId(pageId);
But i get this error :
Cannot implicitly convert type `'System.Data.Linq.ISingleResult<PsychoDataLayer.sproc_GetAverageByPageId> to 'int' .`
Edit 1 The solution that friends implied didn't work . All the time it return 0 For more information i put my stored procedure here :
ALTER procedure [dbo].[sproc_GetAverageByPageId](
@PageId int )
as
select (select sum(score) from votes where pageId = @PageId)/(select count(*) from votes where pageId=@PageId)