Click here to Skip to main content
11,577,965 members (61,257 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# ASP.NET
public class SMSBL
{
    SMSDL dlayer = new SMSDL();
  
    SMSBO player = new SMSBO();
}

When the class gets loads, I'm getting an exception of stack overflow regarding declarations in the above class.
How to prevent stack overflow exception?
Posted 19-Dec-10 19:17pm
Edited 19-Dec-10 19:21pm
JF201553.8K
v2
Comments
JF2015 at 20-Dec-10 1:24am
   
Edited to fix code formatting.
Abhinav S at 20-Dec-10 1:29am
   
You need to provide more information to help someone figure out what the problem could be.
However, by the look of things there is something indide one of SMSDL or SMSBO classes that is causing some sort of an endless recursive code to run.
Sandeep Mewara at 20-Dec-10 1:30am
   
1. You need to be clear on what Stack overflow error is
2. There must be more in your project leading to it(recurrsive instantiation) then just this class.

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Hi...

It's better if you can share some more details about your class implementation.

At first glance it looks like the problem occurring because of never ending recursion. Check if you have classes which have dependencies on each other and they are initializing each other in their constructors.

Thanks and regards,
Chetan Ranpariya
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Peter Leow 170
1 Richard MacCutchan 165
2 DamithSL 150
3 OriginalGriff 145
4 Afzaal Ahmad Zeeshan 125
0 OriginalGriff 830
1 Sergey Alexandrovich Kryukov 701
2 Abhinav S 573
3 F-ES Sitecore 420
4 Dave Kreskowiak 374


Advertise | Privacy | Mobile
Web04 | 2.8.150603.1 | Last Updated 20 Dec 2010
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100