Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

i got this error in my project..how to solve this problem

naresh8500351518naresh8500351518 hyderabadPosts: 1
edited September 2016 in C#

An unhandled exception of type 'System.StackOverflowException' occurred in ELoanDB.dll

Comments

  • IcepickleIcepickle GermanyPosts: 59 ✭✭
    edited September 2016

    Well, without having the code, the most probable suspect is a recursive call, for example you could have something like this

    internal class ExampleOfStackOverflow 
    {
        private string _field;
    
        internal string Field {
            get {
                return _field;
            }
            set {
                Field = value; // it should be _field that gets set and not Field
            }
        }
    }
    

    if you would now create a new class of and read the Field property, you can read it without a problem. If, however, you would set the Field property, you would get a stackoverflow exception, since it will recursively call the same code over and over again.

    If you would now start the debugger, it should point you to the code that caused your StackOverflow. So in the end, without knowing your code it's hard to suggest a fix for it

  • Priyasha SarmahPriyasha Sarmah Posts: 14

    Create a new class of and read the Field property. If, however, you would set the Field property, you would get a stack overflow exception, since it will recursively call the same. For help, visit : http://knowledgetpoint.com/csharp/introduction-to-oops/

Sign In or Register to comment.