Hi ,
I have a table Payment
PaymentID |
PaymentDate |
Medicare |
Medicaid |
VA |
1 |
8 |
30 |
20 |
5 |
2 |
9 |
30 |
20 |
5 |
3 |
10 |
29 |
20 |
6 |
4 |
11 |
29 |
19 |
6 |
and a stored procedure for this table
SELECT Pay_Number, d8 as '8',d9 as '9',d10 as '10',
d11 as '11'
FROM (SELECT [PaymentDate], Amount, Pay_Number
FROM (SELECT 'd'+ Convert (Char(10), [PaymentDate], 112) as [PaymentDate],
[Medicare]
,[Medicaid]
,[VA]
FROM [VDS].[dbo].[Payment]) as sq_source
UNPIVOT (Amount FOR Pay_Number IN
([Medicare]
,[Medicaid]
,[VA])) as sq_up
) as sq
PIVOT (
MIN(Amount)
FOR [PaymentDate] IN
(d8, d9, d10, d11)
) as p;
This stored procedure is used to transpose the column to rows and rows to column like the below,
Medicaid |
20 |
20 |
20 |
19 |
Medicare |
30 |
30 |
29 |
29 |
VA |
5 |
5 |
6 |
6 |
When I tried to connect this stored procedure with my MVC code using Entity framework I am getting the following error
"System.Data.Entity.Core.EntityCommandExecutionException: 'The data reader is incompatible with the specified 'VDSModel.F_MBU_GYNew_NormConc'. A member of the type, 'NormID', does not have a corresponding column in the data reader with the same name.'"
"System.Data.Entity.Core.EntityCommandExecutionException: 'The data reader is incompatible with the specified 'VDSModel.Payment'. A member of the type, 'PaymentID', does not have a corresponding column in the data
thanks,
R