TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
chetan shinde
NA
108
45.5k
MVC Database fetching error
Sep 1 2017 8:00 AM
i am writing Storeprocedure
CREATE PROCEDURE sp_Players_GetWithDrawDtls
-- Add the parameters for the stored procedure here
@userId int,
@fromDt datetime,
@toDt datetime,
@status nvarchar(10),
@type nvarchar(10)
AS
BEGIN
if(@type = 'Withdraw')
begin
select Pc.UserId,(select sum(Amount) from tblPlayerCreditWithdrawaDetails where UserId = @userId and Reqdate between @fromDt and @toDt and Status = 'A') as ApprovedAmount,
(select sum(Amount) from tblPlayerCreditWithdrawaDetails where UserId = @userId and Reqdate between @fromDt and @toDt and Status = 'C') as PendingAmount
from tblPlayerCreditWithdrawaDetails PC
group by pc.UserId
end
else
begin
select Pc.UserId,pc.Reqdate,pc.Amount,pc.Status,pc.Reason,pc.Actiondate
from tblPlayerCreditWithdrawaDetails PC
where UserId = @userId
and Reqdate between @fromDt and @toDt
and Status = @status
end
END
but when i am trying to bind data like :-
var query = db.sp_Players_GetWithDrawDtls(objWithDrawReq.userId, objWithDrawReq.fromDt, objWithDrawReq.toDt, objWithDrawReq.status, "WithdrawReq").ToList();
but it gives me error that
The data reader is incompatible with the specified 'SportsdenModel.sp_Players_GetWithDrawDtls_Result'. A member of the type, 'ApprovedAmount', does not have a corresponding column in the data reader with the same name.
please help me for the same.
Reply
Answers (
1
)
C# Linq to Group to a list if a Condition meets else do not
radio button for two diffrent bool property in MVC5