Adds

Tuesday, 4 June 2013

Insert only time to SQL Server using C# Entity Framework.

Database Tablecreate table Attendance
(
SLNo int IDENTITY(1,1),
EmployeeID varchar(20),
AttendanceDate date,
OfficeStartTime time,
OfficeEndTime time,
EmployeeLoginTime time,
EmployeeLogoutTime time,
WorkingHour int,
Comments varchar(10)
primary key(EmployeeID, AttendanceDate)


at.EmployeeLoginTime = TimeSpan.Parse(DateTime.Now.ToString("hh:mm:ss"));

In database time will store like 14:20:19