Click here to Skip to main content
15,891,184 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi,

How to store resultant count value in decimal value using entiy framwork storedprocedure.
This my code.
This is my storedprocedure.

SQL
alter procedure getavgreview
@cid int
as
begin
SELECT cast((AVG(CAST(Rating as float))) as decimal(10,1)) AS rating FROM CompanyReviews where Cid = @cid
end


this calling storedprocedure in codebehind.

var getavgreview = context.getavgreview(OtherComId);


I want to store getavgreview variable count in decimal variable.

please help me....
Thank you.
Posted
Comments
Ajith K Gatty 21-May-14 6:38am    
Hi NagaRaju, you have to use stored procedure with out parameter which is of type decimal. after the select query set that value to out pararameter. Google it for examples.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900