your requirement is you are using Linq To Sql means a DBML file.
and you are having a store procedure on it.
now are executing the storeprocedure and want the output from store procedure
here i am creating a store p
CREATE PROCEDURE Stock.usp_CheckBuyBookByISBN
-- Add the parameters for the stored procedure here
(
@vcISBN varchar(50),
@retvalue int=0 output
)
AS
BEGIN
SET NOCOUNT ON;
DECLARE @return int
SET @return = (SELECT COUNT(intBUyBAckid) from Stock.BuybackBooks WHERE vcISBN13=@vcISBN AND decPrice>0 )
SET @retvalue=@return
End
here i call the storeprocedure with name usp_CheckBuyBookByISBN and it will return a integer a value.
DataClassesDataContext db = new DataClassesDataContext();
int? b = null;
int a = db.usp_CheckBuyBookByISBN("9780199795352", ref b);
this is how we fetch a the output from store procedure using Linq To Sql
..
now you have a wcf service with json format.
for achving this create a function in wcf and decorate it with a Attribute called as WEBGET
like this.
[OperationContract]
[WebGet(ResponseFormat = WebMessageFormat.Json)]
public int GetResult()
{
DataClassesDataContext db = new DataClassesDataContext();
int? b = null;
int a = db.usp_CheckBuyBookByISBN("9780199795352", ref b);
return a;
}
now simply call that function from you website..
Hope this help.....