TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Abhilash J A
535
2.4k
596.3k
error: Specified cast is not valid.
Dec 7 2016 6:35 AM
Hello everyone,
After implement this code,
public
class
MainUserLogin
{
public
Nullable<DateTime> LogInTime {
get
;
set
; }
public
Nullable<DateTime> 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<Int64>(
"Id"
),
FirstName = m.Field<
string
>(
"FirstName"
),
SurName = m.Field<
string
>(
"SurName"
),
LogInTime = m.Field<DateTime?>(
"LogInTime"
),
LogOutTime = m.Field<DateTime?>(
"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?
Reply
Answers (
3
)
login form and logout in mdiparent from
Move Files from one directory to another directory in FTP