473,385 Members | 1,893 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Variables not initialized

I have included a module in my ASP.Net project. The problem is, that only
every 4th or 5th start of the project the New() constructor is called. If I
use this
code in a normal VB.Net project, everything works fine. Any suggestions why
it only works every 5th time?

If New() is called, _GeneralPath is
"C:\Inetpub\wwwroot\E49-Franz\JDISPO49\WEBBDE.NET"
which is mapped to _ProgramPath in this example.

The next starts, I only have "E49-Franz" in _ProgramPath.
But I didn't change it.
After some starts, the New() constuctor is called again and
everything is ok.

Here is the code.

Namespace FAUSERAG.Parameters
Public Module Parameter
Public Class t_DBParameters
Public Class t_Path

Private _GeneralPath As String = ""
Private _ProgramPath As String = ""
Private _AddonPath As String = ""

Public Sub New()
_GeneralPath = HttpContext.Current.Server.MapPath("") &
"\"
_ProgramPath = _GeneralPath
_AddonPath = _GeneralPath & "images\"
End Sub
Public Property ProgramPath() As String
Get
Return _ProgramPath
End Get
Set(ByVal Value As String)
_ProgramPath = Value
End Set
End Property
Public Property GeneralPath() As String
Get
Return _GeneralPath
End Get
Set(ByVal Value As String)
_GeneralPath = Value
End Set
End Property
Public Property AddonPath() As String
Get
Return _AddonPath
End Get
Set(ByVal Value As String)
_AddonPath = Value
End Set
End Property

End Class
Public Path As t_Path = New t_Path
End Class
Public DBParameters As t_DBParameters = New t_DBParameters
End Module
End Namespace

Best regards,
Marc Fauser
Nov 18 '05 #1
1 987
Hi,

try to change "" with Nothing.

HTH

Natty Gur[MVP]

blog : http://weblogs.asp.net/ngur
Mobile: +972-(0)52-8888377
*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #2

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

Similar topics

30
by: Neil Zanella | last post by:
Hello, Suppose I have some method: Foo::foo() { static int x; int y; /* ... */ }
5
by: Ross A. Finlayson | last post by:
Hi, I'm scratching together an Access database. The development box is Office 95, the deployment box Office 2003. So anyways I am griping about forms and global variables. Say for example...
9
by: vp | last post by:
Can I safely assume that all static variables are initialized as NULL or zero, depending on the types of the variables, no matter on which platform that app is compiled ? Thanks for your help, ...
6
by: Alfonso Morra | last post by:
Hi, I have a function declared thus: int foo( int, int ); In the definition, I want to have a variable that is expensive to create. I want to be able to save the state of this variable...
28
by: Dennis | last post by:
I have a function which is called from a loop many times. In that function, I use three variables as counters and for other purposes. I can either use DIM for declaring the variables or Static. ...
27
by: Madhav | last post by:
Hi all, I did not understand why do the global vars are initialized to NULL where as the block level variables have random values? I know that the C standard requires this as was mentioned in a...
6
by: main() | last post by:
I'm a newbie. These questions arose out of my curiosity, Please pardon me if this questions sound silly. 1. Why are the automatic variables are left uninitialized by default( as i understand...
55
by: Zytan | last post by:
I see that static is more restricted in C# than in C++. It appears usable only on classes and methods, and data members, but cannot be created within a method itself. Surely this is possible in...
1
weaknessforcats
by: weaknessforcats | last post by:
C++: The Case Against Global Variables Summary This article explores the negative ramifications of using global variables. The use of global variables is such a problem that C++ architects have...
9
by: raashid bhatt | last post by:
does having more variables increases the size of program.
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
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...

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.