Hi Every one!
i have a data gridview consisting of four column
all are of date/time data types.
i want to add the first to columns Total_Time and Start_Time and show the result into third column End_Time and the coresponding day in the fourth column Day.
the total_Time may consist of more then 24 hours. I am trying to do this for three days but i can't......
How i can do this in c#(visual studio 2005) connected to Ms Acces Database.

You can either construct SELECT statement to do the calculation or override GridView DataBound event handler to perform the calculation, please mention are you working in web-based\windows-based application?

Thank you for ur reply.
I am working in window base application.

my code to solve this problem is as below

TimeSpan spanTotal = ((DateTime)dataGridView1.Rows[i].Cells[2].Value).TimeOfDay;
TimeSpan spanTimeStart = ((DateTime)dataGridView1.Rows[i].Cells[3].Value).TimeOfDay;
TimeSpan spantTiemEnd = spanTimeStart.Add(spanTotal);

this add the two times but when the time exceed from 24 hours it stop. for example if i need to add 26:30Hours with 11:10 Am then it does not work

26:30 Hours represent 26 Hours and 30 minutes which i want to add with 11:10 Am which represents a time of day.
Example i mean i want to add
(11:10 AM Monday)+(26:30)=(2:40 PM Tuesday)

This article has been dead for over six months. Start a new discussion instead.