Wrox Programmer Forums
|
VS.NET 2002/2003 Discussions about the Visual Studio.NET programming environment, the 2002 (1.0) and 2003 (1.1). ** Please don't post code questions here ** For issues specific to a particular language in .NET, please see the other forum categories.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VS.NET 2002/2003 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 20th, 2004, 01:37 AM
Authorized User
 
Join Date: Jun 2003
Posts: 61
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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!
 
Old July 20th, 2004, 03:06 AM
Authorized User
 
Join Date: Jun 2003
Posts: 63
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi

can you not change the "DateInterval.Minute" line to "DateInterval.Hour" and remove the "TotalHours = Math.Round((TotalHours / 60), 2)" all together

Just a thought

Duncan





Similar Threads
Thread Thread Starter Forum Replies Last Post
system.stackoverflowexception in system.windows.fo scheidel21 Pro VB.NET 2002/2003 2 May 18th, 2007 12:40 AM
How to solve System.StackOverFlowException sibajibasak General .NET 3 February 11th, 2005 12:36 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.