Click here to Skip to main content
15,887,676 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a SP which is accepting two parameters and returning one table as data is coming from more than 3 tables.

I need to consume my SP in Web API to Generate desired XML.
SQL
PROC [dbo].[Sp_DATA1]
(
@schemecode nvarchar(10),
@month nvarchar(10)
)
AS
BEGIN
DECLARE
@totalnoofemployees int ,

.
.
.
.
.
.
.
 
 Savings int,
 remarks  nvarchar(500) 

 )
select @totalnoofemployees=count(employeedetails.name_of_employee)  from employeedetails where schemecode=schemecode  and month=@month 
select .
.
.
.

.
select @remark =remark from saving_details  where schemecode=@schemecode  and month=@month  




insert into @tab([Number_of_employees],
.
.
.
.
, Other_saving_due_to_process_improvement,savings,remarks)
 values
(@totalnoofemployees,
.
.
.
.
 @savingamount , @remark )

SELECT * from @tab
END


What I have tried:

when i am generating it by table it is showing data


public class EmployeesController : ApiController
  {
       public IEnumerable<beneficiarydetail> Get([ModelBinder]List<int> id)
      {
          emp_misEntities entities = new emp_misEntities();

          return entities.beneficiarydetails.ToList();
      }

  }


but when i tried to get data from SP :(
Posted
Updated 8-Aug-18 22:17pm
v3

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