Click here to Skip to main content
15,885,985 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I found This Error when I run This Progrmae


"
CSS
Server Error in '/' Application.
The data reader is incompatible with the specified 'DBLaxmiTatkalModel.TblAttendence'. A member of the type, 'AttendenceId', does not have a corresponding column in the data reader with the same name.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.EntityCommandExecutionException: The data reader is incompatible with the specified 'DBLaxmiTatkalModel.TblAttendence'. A member of the type, 'AttendenceId', does not have a corresponding column in the data reader with the same name.

Source Error:


Line 244:        {
Line 245:
Line 246:            var data = objentity.Attendence(EmployeeId).Take(1).ToList();
Line 247:
Line 248:            return data;


Source File: D:\laxmitatkal project\12-4-2014\7-4-2014\LaxmiTatkal.BussinesLogic\EmployeeBl.cs    Line: 246

"




my sql server procedure is

"
SQL
CREATE PROCEDURE [dbo].[Attendence]
@EmployeeId int
as


if not  exists(select * from TblAttendence where convert(varchar(10) ,CreateDate,23) =convert(varchar(10) ,GETDATE(),23)  and EmployeeId =@EmployeeId)
     select *  from TblAttendence  where convert(varchar(10) ,CreateDate,23) =convert(varchar(10) ,GETDATE(),23)  and EmployeeId =@EmployeeId
Else
           update TblAttendence   set LastLoginTime=GETDATE()    where EmployeeId=@EmployeeId and convert(varchar(10) ,CreateDate,23) =convert(varchar(10) ,GETDATE(),23)
GO





"
Posted
Comments
CHill60 12-Apr-14 10:04am    
The error is telling you what the problem is! How have you created the datareader in your code behind - that's where the issue is, not in your stored procedure

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