Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
1
Reply
ERROR: Specified cast is not valid.
praveen kumar
Apr 29 2015 5:20 AM
474
Reply
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();
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
1
)
Next Recommended Forum
Validation
Collection of strings to xml with LINQ2XML