【发布时间】:2015-05-12 20:17:17
【问题描述】:
我使用存储过程来获取满足该条件的多条记录
CREATE PROCEDURE [dbo].[Sp_GetAttendanceBwDates]
@datefrom datetime,
@dateto datetime,
@empid int
ASBEGIN`
select AM.employee_Id,CONVERT(varchar(10),AM.date,111) from
tblAttendanceMaster AM where AM.employee_Id=@empid and
CONVERT(varchar(10),AM.date,111)<=CONVERT(varchar(10),@datefrom,111)
and CONVERT(varchar(10),AM.date,111)=CONVERT(varchar(10),@dateto,111)
END
在后面的代码中,执行以下代码时出现错误。我不明白
var objattendance = context.Sp_GetAttendanceBwDates(datefrom,dateto,emp);
错误信息
occurred in System.Data.Entity.dll but was not handled in user code.
Additional information: The data reader is incompatible with the specified 'FlairModel.Sp_GetAttendanceBwDates_Result'. A member of the type, 'record_Id', does not have a corresponding column in the data reader with the same name.
【问题讨论】:
标签: sql asp.net sql-server entity-framework entity-framework-4