Hello everyone,
After implement this code,
- public class MainUserLogin
- {
- public Nullable
LogInTime { get; set; } - public Nullable
LogOutTime { get; set; } - public Int64 Id { get; set; }
- public string FirstName { get; set; }
- public string SurName { get; set; }
- }
- List< MainUserLogin> objUserSetUp = userList.Select(m => new MainUserLogin()
- {
- Id = m.Field
("Id"), - FirstName = m.Field<string>("FirstName"),
- SurName = m.Field<string>("SurName"),
- LogInTime = m.Field
("LogInTime"), - LogOutTime = m.Field
("LogOutTime") - }).ToList();
If LoginTime or LogOutTime is existing null then the error is happening "Specified cast is not valid."
How can I solve this error?

Prakash KumarPosted Dec 7, 2016, 7:14 AM
Abhilash J APosted Dec 7, 2016, 7:12 AM
Manas MohapatraPosted Dec 7, 2016, 6:43 AM