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
praveen kumar
NA
188
32.2k
ERROR: Specified cast is not valid.
Apr 29 2015 5:20 AM
Hi,
In datagridview, i am calculating(SUM) the timespan of the whole column, for the i am using the following code but it showing error "Specified cast is not valid.". kindly help me to sort out this issue
TimeSpan sum = TimeSpan.Zero;
for (int i = 0; i < dataGridView1.Rows.Count; i++)
{
sum += (TimeSpan)dataGridView1.Rows[i].Cells[4].Value;
}
label2.Text = sum.ToString();
Reply
Answers (
1
)
Validation
Collection of strings to xml with LINQ2XML