raveen4u 0 Newbie Poster

I am working on multiple forms when I write this code in a new form its giving me System.Overflow exception

Previously I worked on few form but never encountered a problem

plz solve this prob


Private Sub dbaCBCHonororium_Add() Handles dbaCBCHonororium.Add
Dim ObjCBCHon As clsCBCHonororium
Try
Cursor.Current = Cursors.WaitCursor
'dbaCBCHonororium.Mode = DBActions.ModeConstants.Edit
ObjCBCHon = New clsCBCHonororium
'set the Department object properties before the data could be saved
SetObjProperties(ObjCBCHon)
If dbaCBCHonororium.Mode = DBActions.ModeConstants.Add Then
Call BeginDBTransactions()
'insert into Department table
'f ValidateData() = True Then
If ObjCBCHon.CBCHonororiumExecute(DBA.DBInsert) = True Then
Call CommitDBTransactions()
End If
Dim NotifyMessage As New NotifyMsg("Honororium details saved", "CBCHonororium")
'NotifyMessage.Show()
MessageBox.Show("Honororium details saved", "CBCHonoroium", _
MessageBoxButtons.OK, MessageBoxIcon.Information)
dbaCBCHonororium.SaveImplemented = True
'fgSearch.Enabled = True
'Get the ID of New Department
currCBCHonIDPK = ObjCBCHon.CBCHonIDFK
'lock form controls
'LockFormControls(True)
'set fore color blue
SetForeColorForControls(False)
' Else
Call RollbackDBTransactions()
MessageBox.Show("Failed to save Honoroium details", "Honororium", _
MessageBoxButtons.OK, MessageBoxIcon.Information)
End If
'End If
' Else if dbaCBCHonororium.Mode = DBActions.ModeConstants.Edit Then
'Call BeginDBTransactions()
'update into Department record
ObjCBCHon.CBCHonIDFK = currCBCHonIDPK
If ObjCBCHon.CBCHonororiumExecute(DBA.DBUpdate) = True Then
Call CommitDBTransactions()
MessageBox.Show("Honororium Details are updated", "Honororium", _
MessageBoxButtons.OK, MessageBoxIcon.Information)
dbaCBCHonororium.SaveImplemented = True
'fgSearch.Enabled = True
'Show the updated information on the grid
'RefreshGridRow()
'lock form controls
'LockFormControls(True)
'set fore color blue
SetForeColorForControls(False)
Else
Call RollbackDBTransactions()
MessageBox.Show("Failed to update Honororium ", "Honrorium", _
MessageBoxButtons.OK, MessageBoxIcon.Information)
End If
'End If
'mark Dept object for garbage collection
Catch e As Exception
'error handler
NotifyException(e)
Call RollbackDBTransactions()
Finally
Cursor.Current = Cursors.Default
End Try
'destroy reference
ObjCBCHon = Nothing
System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.Default

End Sub

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.