我在运行My programe时发现此错误数据读取器与指定的'DBLaxmiTatkalModel.TblAttendence'不兼容。该类型的成员'AttendenceId'没有...... [英] I found This Error When I run My programe The data reader is incompatible with the specified 'DBLaxmiTatkalModel.TblAttendence'. A member of the type, 'AttendenceId', does not have a...

查看:142
本文介绍了我在运行My programe时发现此错误数据读取器与指定的'DBLaxmiTatkalModel.TblAttendence'不兼容。该类型的成员'AttendenceId'没有......的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我跑这个程序时发现这个错误







I found This Error when I run This Progrmae


"

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













我的sql server程序是






"




my sql server procedure is

"

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
















"

推荐答案

这篇关于我在运行My programe时发现此错误数据读取器与指定的'DBLaxmiTatkalModel.TblAttendence'不兼容。该类型的成员'AttendenceId'没有......的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆