Results 1 to 5 of 5

Thread: [RESOLVED] System.StackOverflowException was unhandled

  1. #1

    Thread Starter
    Member
    Join Date
    Dec 2009
    Posts
    37

    Resolved [RESOLVED] System.StackOverflowException was unhandled

    I'm getting a "System.StackOverflowException was unhandled" exception here:

    Code:
    Private Sub showDetailsView_DataBound(ByVal sender As Object, ByVal e As System.EventArgs) Handles showDetailsView.DataBound
            showDetailsView.DataBind()
        End Sub
    when the showDetailsView (a DetailsView component) is made visible by the detailsButton_Click event sub... Why is this happening, and how can I fix this issue?

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: System.StackOverflowException was unhandled

    The DataBind method raises the DataBound event. You're handling the DataBound event, and in it, you're calling DataBind. Repeat until stack overflow. Not sure why you're rebinding in the binding event.

    The DataBind method is probably being called elsewhere on the page or automatically when you make it visible.

  3. #3
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: System.StackOverflowException was unhandled

    Hey,

    jwesleycooper can you show the rest of your code? Or was Mendhak's suggestion enough? Have you been able to stop this exception happening?

    Here is some more information:

    http://msdn.microsoft.com/en-us/libr...24(VS.80).aspx

    Gary

  4. #4

    Thread Starter
    Member
    Join Date
    Dec 2009
    Posts
    37

    Resolved Re: System.StackOverflowException was unhandled

    It seems that I just made a rather silly mistake What I should have done was place the showDetailsView.DataBind() line in my detailsButton_Click sub, to ensure that it is actually displaying the data pertinent to the latest user seletion. Guess that's what happens to my thought processes when I stay up three hours later than usual!

  5. #5
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: [RESOLVED] System.StackOverflowException was unhandled

    Ha ha, we have all been there!!

    Glad you got it sorted!!

    Gary

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width