Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8958207
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T15:09:34+00:00 2026-06-15T15:09:34+00:00

Using recursion to build up the hierarchy. This recursion works fine in windows server

  • 0

Using recursion to build up the hierarchy.

This recursion works fine in windows server 2003 + IIS6 but throwing exception in windows server 2008 R2 and IIS 7.0

Here is the code snippet:

Public Sub Expand(ByVal SE_Index As Int64)

    Dim row As DataRow

    If aryHierarchyData(SE_Index).Visable = True Then
        aryHierarchyData(SE_Index).Target_Row = gvCurrent_Row_Number
        gvCurrent_Row_Number = gvCurrent_Row_Number + 1

        Try
            row = dtExpand.NewRow
            row("SE_NO") = aryHierarchyData(SE_Index).SE_No
            row("Selection_Index") = aryHierarchyData(SE_Index).Selection_Index
            **dtExpand.Rows.Add(row)**--->>>throwing error "stackoverflow"

        Catch ex As StackOverflowException
            If (ex.Message.Contains("Column 'SE_NO, Selection_Index' is constrained to  be unique.")) Then
                Exit Sub
            End If

        Catch ex As Exception

        Finally
            row = Nothing
        End Try

        ' expand this SE's children  -  first
        If aryHierarchyData(SE_Index).Child > 0 Then
            Expand(aryHierarchyData(SE_Index).Child)
        End If
    End If

    ' expand this SE's Siblings  -  second

    If aryHierarchyData(SE_Index).Sibling > 0 Then
        Expand(aryHierarchyData(SE_Index).Sibling)
    End If

End Sub
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T15:09:35+00:00Added an answer on June 15, 2026 at 3:09 pm
    Stackoverflow problem could be solved using thread.
    Call expand() under recursivethread function.
    
    Private Sub RecurseThread(totalSeCount As Long)
     For iIdx = 1 To totalSeCount
        If aryHierarchyData(iIdx).Target_Row = 0 Then
        dtExpand.Clear()
        dtExpand.AcceptChanges()
        Expand(iIdx)
      End If
    Next iIdx
    End Sub
    
    Dim t As Thread = New Thread(AddressOf RecurseThread, 1024 * 1024)
    t.Start(totalSeCount)
    t.Join()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We've been using git-buildpackage to build Debian packages with great success, but we've recently
Problem: I am trying to build a recursive tree using a function and data
Using recursion, find an index that cuts an array in two parts so that
I read that using recursion with Divide and Conquer method is efficient. Could anyone
I am using recursion and I want an Integer object to retain its value
Using java I am trying to develop a method using recursion to analyze a
I am trying to solve Project Euler problem in Clojure using recursion. The following
Throughout a Bison grammar I am using right recursion, and I have read that
I'm trying to find a file using BFS and recursion , where given a
This question is related to this SO post Rather than using a recursive CTE

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.