473,473 Members | 2,092 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

System.StackOverflowException

Hi All,

When I set the property of title in my class (Shown below) I get a
"Exception of type System.StackOverflowException was thrown." error message.

I'm guessing I got some sort of horrible loop going on, where did I go
wrong?

Thanks,
Simon.

Private pTitleAs String

Public Property Title() As String
Get
Return pStrTitle
End Get
Set(ByVal Value As String)
Title = pStrTitle
End Set
End Property
Nov 19 '05 #1
4 2730
Hello
Change
Title = pStrTitle
to
pStrTitle = Value

Best regards,
Sherif

"Simon Harris" <to***********@makes-you-fat.com> wrote in message
news:u1**************@TK2MSFTNGP10.phx.gbl...
Hi All,

When I set the property of title in my class (Shown below) I get a
"Exception of type System.StackOverflowException was thrown." error
message.

I'm guessing I got some sort of horrible loop going on, where did I go
wrong?

Thanks,
Simon.

Private pTitleAs String

Public Property Title() As String
Get
Return pStrTitle
End Get
Set(ByVal Value As String)
Title = pStrTitle
End Set
End Property

Nov 19 '05 #2
you're setting the title of the string with pstrTitle, but the set action
itself calls the property again recursively. The solution provided by sherif
will fix the problem, i just thought you wanted to know the why.

--
Regards,
Alvin Bruney - ASP.NET MVP

[Shameless Author Plug]
The Microsoft Office Web Components Black Book with .NET
Now available @ www.lulu.com/owc, Amazon.com etc
"Simon Harris" <to***********@makes-you-fat.com> wrote in message
news:u1**************@TK2MSFTNGP10.phx.gbl...
Hi All,

When I set the property of title in my class (Shown below) I get a
"Exception of type System.StackOverflowException was thrown." error
message.

I'm guessing I got some sort of horrible loop going on, where did I go
wrong?

Thanks,
Simon.

Private pTitleAs String

Public Property Title() As String
Get
Return pStrTitle
End Get
Set(ByVal Value As String)
Title = pStrTitle
End Set
End Property

Nov 19 '05 #3
Never mind - Realised my properties were in a right old mess :)
"Simon Harris" <to***********@makes-you-fat.com> wrote in message
news:u1**************@TK2MSFTNGP10.phx.gbl...
Hi All,

When I set the property of title in my class (Shown below) I get a
"Exception of type System.StackOverflowException was thrown." error
message.

I'm guessing I got some sort of horrible loop going on, where did I go
wrong?

Thanks,
Simon.

Private pTitleAs String

Public Property Title() As String
Get
Return pStrTitle
End Get
Set(ByVal Value As String)
Title = pStrTitle
End Set
End Property

--
I am using the free version of SPAMfighter for private users.
It has removed 2175 spam emails to date.
Paying users do not have this message in their emails.
Try www.SPAMfighter.com for free now!
Nov 19 '05 #4
....but thanks for the replies (I posted my reply before yours appeared)

Nov 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Martyn Wynne | last post by:
Hi, Can anyone please tell me if there is any reason why when i am streaming from a webrequest (decompressing on route) to a file on the hard drive, i would be getting an exception of Filestream...
5
by: Jesee | last post by:
I am reading Jeffrey Richter's book "Applied Microsoft .NET Framework programming",i came across "Exception handing". Page 405 says "If the stack overflow occurs within the CLR itself,your...
2
by: Anders Both | last post by:
In a system with asynkronius socket and different collection, there are some times throw a System.StackOverflowException . I cannot really figur out why , Can someone say something clever about...
12
by: Amy | last post by:
I'm getting a System.StackOverflowException, and I can't see why. Here's the code that's throwing the exception. I don't see anyting that's recursive about it. Any help is appreciated (including...
3
by: Patrick.O.Ige | last post by:
Error:- System.StackOverflowException: Exception of type System.StackOverflowException was thrown. When is this thrown.. Any ideas
0
by: Nikhil Khade | last post by:
Hello, After around 3 months, I reopened a old VB.NET solutions which used to work (and build) without any errors. Just to test it again, I build it again and it completed, without any errors,...
10
by: Mae Lim | last post by:
Dear all, I'm new to C# WebServices. I compile the WebService project it return no errors "Build: 1 succeeded, 0 failed, 0 skipped". Basically I have 2 WebMethod, when I try to invoke the...
2
by: Modica82 | last post by:
Hi all, I am trying to generate a stub class for my web service using wsdl.exe but every time i run it from the visual studio command prompt i get a System.StackOverFlowException. Has anyone...
1
by: HyVong | last post by:
Hi Everyone, please help, i'm very frustrated because i can't run my application. I built my application using the .NET Installer, i ran the installer on the development machine and it sets the...
12
by: daz_oldham | last post by:
Hi everyone As my expedition into OOP takes another shaky step, I now am getting the error: An unhandled exception of type 'System.StackOverflowException' occurred in xxx.dll. In my...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.