Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Stack Overflow Exception ?

Status
Not open for further replies.

need2progm

Programmer
Dec 13, 2002
92
US
Need direction..

I am getting a stack overflow exception and need to know where to go to trouble shot this.

I have researched MSDN... wasn't much help. I understand what it is but do not understand why I am getting this error or what to do to fix it.

I do not seem to have any recursive methods but do realize that we have not done a very good job of cleanup behind ourselves as far as setting sessions and creating business obj's.

Thanks for your thoughts
 
Can you post the code showing where its happneing?

D'Arcy
 
That error (in my experience) has always been either
(a) infinite loop
(b) inadvertant recursive call

To the recursive call point, a mistake I often make will be stating the name of the property when I set it, instead of the private variable name:

public string someVar{
set{someVar = value;}
}

Something resembling the above is usually where I'll get the error.

But like D'Arcy said, w/o code, it's pretty tough to nail it down.

hth -
paul
penny1.gif
penny1.gif

The answer to getting answered -- faq855-2992
 
I get the error creating a new user obj

Dim newUserAnswer As New ParticipantAnswertestTaker.EmployeeID, thisAssessVersion.AssessmentID, thisAssessVersion.VersionNumber, QID, CurrentUser)
newUserAnswer.Insert(CurrentUser)
Session("newuserAnswer") = newUserAnswer

This is in a sub proceedure

What other code would you like to see?

thanks for the help
 
Still hard to say, but I'd start looking for that recursive property error I alluded to, seeing that you're using properties there... it might be a good place to start looking.

Also, you could put a break point on that line of code, and just f11 your way through it till you hit your loop.

-paul
penny1.gif
penny1.gif

The answer to getting answered -- faq855-2992
 
Dim newUserAnswer As New ParticipantAnswertestTaker.EmployeeID, thisAssessVersion.AssessmentID, thisAssessVersion.VersionNumber, QID, CurrentUser)

There is a '(' missing in that line. Not sure if that is causing problems or not the compiler should have caught that before it ran. That'l do donkey, that'l do
[bravo] Mark
If you are unsure of forum etiquette check here faq796-2540
 
I do have the "(" in my code .. don't know why it did not post?

As I was F11 through my code I did not get into an endless loop .. but I have created several objects.. saving them in sessions and reffering back to them through out this aspx page.

my logic.. on a click event of a List bar

'get currentuser
Dim CurrentUser As GyrusUser
CurrentUser = Session("Currentuser")

Dim testTaker As Employee
testTaker = Session("testTaker")

'get this Assessment Version sent on request.querrystring
Dim thisAssessVersion As AssessVersion
thisAssessVersion = Session("thisAssessVersion")

Dim thisAssessVersionQuestion As AssessVersionQuestion
Dim allAssessVersionQuestions As AssessVersionQuestions
allAssessVersionQuestions = Session ("allAssessVersionQuestions")


Dim AnswerLangs As New AnswerLangs()

With x.SelectedItem
'used with question type 1,2,3

For Each thisAssessVersionQuestion In allAssessVersionQuestions

Dim thisQuest As New Question(thisAssessVersionQuestion.QuestionID, CurrentUser)

If thisQuest.QuestionType = 1 Or 2 Or 3 Then

Dim questType As Integer = thisQuest.QuestionType
If .Text = thisQuest.Name Then
If questType = 1 Then 'Fill in the Blank"
ShowMe() 'textboxs and labels visable
getAnswerTable(questType) 'adding HeaderRow and cells
addRowAnswerTable(thisQuest)'adds row and

********this is where it will blow**********
TestTakerObject(thisQuest.QuestionID)'creates userAnswer obj

when I F11 through the above sub and get to the newUserAnswer it blows.


So if I am not caught in recursive call( I am not 100% sure that I am not) could this be caused by to many obj's created ? Or to many sessions ?


 
Ok got to work... F11 through the code again ..found this do you see the problem?
When creating a newUserAnswer it is sent QuestionID


Public Overrides Property QuestionID() As Int32
Get
Return mQuestionID
End Get
Set(ByVal Value As Int32)
QuestionID = Value
End Set
End Property


1 missing byte .. m

Thanks Paul for direction on where to look ..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top