StackOverFlowException Problem
Hello guyz can somebody please help me out here this small function code is givin me hell, Please help.
Public Shared Sub Column_Changed(ByVal sender As Object, ByVal e As DataColumnChangeEventArgs)
Dim TotalHours As Decimal = 0
Dim TotalPay As Decimal = 0
Dim Start As DateTime = Nothing
Dim Finish As DateTime = Nothing
Try
Start = CType(e.Row.Item("fldStartTime"), DateTime)
Finish = CType(e.Row.Item("fldEndTime"), DateTime)
TotalHours = (DateDiff(DateInterval.Minute, Start, Finish, _
FirstDayOfWeek.Monday)) - e.Row.Item("fldBreakTime")
TotalHours = Math.Round((TotalHours / 60), 2)
e.Row.Item("fldDayHours") = TotalHours
Catch ex As System.StackOverflowException
End Try
End Sub
My Scenario: This is an event of column changed in the DataColumnEventHandler object. Anyway, i would like it to calculate the hours between two dates as u can see. The problem comes when i divide 60 (highlighted in red above) it keeps throwing the StackOverFlowException even when am catching the exception. Please help. if u know wassup!!
LION OF JUDDAH!
__________________
LION OF JUDDAH!
|